am 64dc0380: Fix layoutlib [DO NOT MERGE]

* commit '64dc0380127047ffcf135b6848c9150aa8dbed85':
  Fix layoutlib [DO NOT MERGE]
This commit is contained in:
Deepanshu Gupta
2014-05-13 01:52:21 +00:00
committed by Android Git Automerger

View File

@@ -246,11 +246,16 @@ public abstract class RenderAction<T extends RenderParams> extends FrameworkReso
* The counterpart is {@link #setUp()}. * The counterpart is {@link #setUp()}.
*/ */
private void tearDown() { private void tearDown() {
// Make sure to remove static references, otherwise we could not unload the lib // The context may be null, if there was an error during init().
mContext.disposeResources(); if (mContext != null) {
// Make sure to remove static references, otherwise we could not unload the lib
mContext.disposeResources();
}
// quit HandlerThread created during this session. if (sCurrentContext != null) {
HandlerThread_Delegate.cleanUp(sCurrentContext); // quit HandlerThread created during this session.
HandlerThread_Delegate.cleanUp(sCurrentContext);
}
// clear the stored ViewConfiguration since the map is per density and not per context. // clear the stored ViewConfiguration since the map is per density and not per context.
ViewConfiguration_Accessor.clearConfigurations(); ViewConfiguration_Accessor.clearConfigurations();
@@ -261,8 +266,12 @@ public abstract class RenderAction<T extends RenderParams> extends FrameworkReso
sCurrentContext = null; sCurrentContext = null;
Bridge.setLog(null); Bridge.setLog(null);
mContext.getRenderResources().setFrameworkResourceIdProvider(null); if (mContext != null) {
mContext.getRenderResources().setLogger(null); mContext.getRenderResources().setFrameworkResourceIdProvider(null);
mContext.getRenderResources().setLogger(null);
}
mContext = null;
} }
public static BridgeContext getCurrentContext() { public static BridgeContext getCurrentContext() {