summaryrefslogtreecommitdiffstats
path: root/WebKit/android/jni/WebCoreFrameBridge.cpp
diff options
context:
space:
mode:
authorPatrick Scott <>2009-03-24 22:40:29 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-24 22:40:29 -0700
commitd0f504d63d255cc7d9acd429f7f9506befef4a61 (patch)
treeb9044acc454bf048b8b4222cc9e7c5ddabc10269 /WebKit/android/jni/WebCoreFrameBridge.cpp
parent6d20683c4bff963e2e8ca340cd968db81a9b81ec (diff)
downloadexternal_webkit-d0f504d63d255cc7d9acd429f7f9506befef4a61.zip
external_webkit-d0f504d63d255cc7d9acd429f7f9506befef4a61.tar.gz
external_webkit-d0f504d63d255cc7d9acd429f7f9506befef4a61.tar.bz2
Automated import from //branches/donutburger/...@142403,142403
Diffstat (limited to 'WebKit/android/jni/WebCoreFrameBridge.cpp')
-rw-r--r--WebKit/android/jni/WebCoreFrameBridge.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp
index ccca088..91103fb 100644
--- a/WebKit/android/jni/WebCoreFrameBridge.cpp
+++ b/WebKit/android/jni/WebCoreFrameBridge.cpp
@@ -953,10 +953,10 @@ protected:
JNIEnv* env = getJNIEnv();
// This is odd. getRealObject returns an AutoJObject which is used to
// cleanly create and delete a local reference. But, here we need to
- // maintain the local reference across calls to strong() and weak().
- // So, create a new local reference to the real object here and delete
- // it in weak().
- _realObject = env->NewLocalRef(getRealObject(env, _weakRef).get());
+ // maintain the local reference across calls to virtualBegin() and
+ // virtualEnd(). So, release the local reference from the AutoJObject
+ // and delete the local reference in virtualEnd().
+ _realObject = getRealObject(env, _weakRef).release();
// Point to the real object
_instance->_instance = _realObject;
// Call the base class method
@@ -964,12 +964,12 @@ protected:
}
virtual void virtualEnd() {
- // Get rid of the local reference to the real object
+ // Call the base class method first to pop the local frame.
+ INHERITED::virtualEnd();
+ // Get rid of the local reference to the real object.
getJNIEnv()->DeleteLocalRef(_realObject);
// Point back to the WeakReference.
_instance->_instance = _weakRef;
- // Call the base class method
- INHERITED::virtualEnd();
}
private: