summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2014-05-13 01:52:21 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-13 01:52:21 +0000
commit06c4f23d737082717f37f5f3583d9c12f4b64bf2 (patch)
tree64b766589afd8e060291cf494adf4e9f64b3651a /tools/layoutlib
parentcdb87d8d83e8a76a4cf78d24d5c49ee8548eba1f (diff)
parent64dc0380127047ffcf135b6848c9150aa8dbed85 (diff)
downloadframeworks_base-06c4f23d737082717f37f5f3583d9c12f4b64bf2.zip
frameworks_base-06c4f23d737082717f37f5f3583d9c12f4b64bf2.tar.gz
frameworks_base-06c4f23d737082717f37f5f3583d9c12f4b64bf2.tar.bz2
am 64dc0380: Fix layoutlib [DO NOT MERGE]
* commit '64dc0380127047ffcf135b6848c9150aa8dbed85': Fix layoutlib [DO NOT MERGE]
Diffstat (limited to 'tools/layoutlib')
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java21
1 files changed, 15 insertions, 6 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java
index b20f190..60b20a6 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java
@@ -246,11 +246,16 @@ public abstract class RenderAction<T extends RenderParams> extends FrameworkReso
* The counterpart is {@link #setUp()}.
*/
private void tearDown() {
- // Make sure to remove static references, otherwise we could not unload the lib
- mContext.disposeResources();
+ // The context may be null, if there was an error during init().
+ if (mContext != null) {
+ // Make sure to remove static references, otherwise we could not unload the lib
+ mContext.disposeResources();
+ }
- // quit HandlerThread created during this session.
- HandlerThread_Delegate.cleanUp(sCurrentContext);
+ if (sCurrentContext != null) {
+ // quit HandlerThread created during this session.
+ HandlerThread_Delegate.cleanUp(sCurrentContext);
+ }
// clear the stored ViewConfiguration since the map is per density and not per context.
ViewConfiguration_Accessor.clearConfigurations();
@@ -261,8 +266,12 @@ public abstract class RenderAction<T extends RenderParams> extends FrameworkReso
sCurrentContext = null;
Bridge.setLog(null);
- mContext.getRenderResources().setFrameworkResourceIdProvider(null);
- mContext.getRenderResources().setLogger(null);
+ if (mContext != null) {
+ mContext.getRenderResources().setFrameworkResourceIdProvider(null);
+ mContext.getRenderResources().setLogger(null);
+ }
+
+ mContext = null;
}
public static BridgeContext getCurrentContext() {