Merge "Fix issue #2951784: Launcher crashes on startup" into gingerbread
This commit is contained in:
committed by
Android (Google) Code Review
commit
0a7f5fc474
@@ -348,6 +348,7 @@ public abstract class LayoutInflater {
|
||||
public View inflate(XmlPullParser parser, ViewGroup root, boolean attachToRoot) {
|
||||
synchronized (mConstructorArgs) {
|
||||
final AttributeSet attrs = Xml.asAttributeSet(parser);
|
||||
Context lastContext = (Context)mConstructorArgs[0];
|
||||
mConstructorArgs[0] = mContext;
|
||||
View result = root;
|
||||
|
||||
@@ -432,12 +433,12 @@ public abstract class LayoutInflater {
|
||||
+ ": " + e.getMessage());
|
||||
ex.initCause(e);
|
||||
throw ex;
|
||||
} finally {
|
||||
// Don't retain static reference on context.
|
||||
mConstructorArgs[0] = lastContext;
|
||||
mConstructorArgs[1] = null;
|
||||
}
|
||||
|
||||
// Told retain static reference on context.
|
||||
mConstructorArgs[0] = null;
|
||||
mConstructorArgs[1] = null;
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user