summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dianne Hackborn <hackbod@google.com> 2010-08-26 10:50:11 -0700
committer Android Git Automerger <android-git-automerger@android.com> 2010-08-26 10:50:11 -0700
commitefd05ea69a53d73d2dacacd74f6a420cac8ef97b (patch)
treeaef518be9b2267c2340c31909ddd464ea920f560
parent2db7330578c1ac4466f4cbbf0f7723df6c2da305 (diff)
parent0a7f5fc474182c58b478d8f9017209dcf8d0ca0b (diff)
am 0a7f5fc4: Merge "Fix issue #2951784: Launcher crashes on startup" into gingerbread
Merge commit '0a7f5fc474182c58b478d8f9017209dcf8d0ca0b' into gingerbread-plus-aosp * commit '0a7f5fc474182c58b478d8f9017209dcf8d0ca0b': Fix issue #2951784: Launcher crashes on startup
-rw-r--r--core/java/android/view/LayoutInflater.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/java/android/view/LayoutInflater.java b/core/java/android/view/LayoutInflater.java
index 322812738cc2..194c01357613 100644
--- a/core/java/android/view/LayoutInflater.java
+++ b/core/java/android/view/LayoutInflater.java
@@ -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;
}
}