am 06c4f23d: am 64dc0380: Fix layoutlib [DO NOT MERGE]

* commit '06c4f23d737082717f37f5f3583d9c12f4b64bf2':
  Fix layoutlib [DO NOT MERGE]
This commit is contained in:
Deepanshu Gupta
2014-05-13 01:57:25 +00:00
committed by Android Git Automerger

View File

@@ -247,11 +247,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();
@@ -262,8 +267,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() {