summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-08-26 10:47:48 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-08-26 10:47:48 -0700
commit0a7f5fc474182c58b478d8f9017209dcf8d0ca0b (patch)
tree3ccf7bb7660ef0358698cca952bbb5780437fb54 /core
parentdfded35b3a5cb8eb57d47b750f3a4b0085fd3c0a (diff)
parent9dae48e3992521f104cde7c916ed1fb5ee1ecb54 (diff)
downloadframeworks_base-0a7f5fc474182c58b478d8f9017209dcf8d0ca0b.zip
frameworks_base-0a7f5fc474182c58b478d8f9017209dcf8d0ca0b.tar.gz
frameworks_base-0a7f5fc474182c58b478d8f9017209dcf8d0ca0b.tar.bz2
Merge "Fix issue #2951784: Launcher crashes on startup" into gingerbread
Diffstat (limited to 'core')
-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 3228127..194c013 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;
}
}