diff options
author | Steve Block <steveblock@google.com> | 2011-02-23 13:49:10 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-02-23 13:49:10 +0000 |
commit | e5d2646223c750b4d6785d48b4b9026524e82324 (patch) | |
tree | ef09285a5602bd7f28a3845c44b88f4ded7d162c /WebKit/android/jni/WebCoreJni.h | |
parent | fc4a7c214a17115d92d1a036c76221e1bca8bcb5 (diff) | |
download | external_webkit-e5d2646223c750b4d6785d48b4b9026524e82324.zip external_webkit-e5d2646223c750b4d6785d48b4b9026524e82324.tar.gz external_webkit-e5d2646223c750b4d6785d48b4b9026524e82324.tar.bz2 |
Copy constructor for AutoJObject must increase the ref count on the underlying object
This is needed to balance the derefs in any temporary instance's d'tor.
See https://chromereview.prom.corp.google.com/2013001
Change-Id: I8329f475ecbd1bc8669d0e8d368f1a385d891fb3
Diffstat (limited to 'WebKit/android/jni/WebCoreJni.h')
-rw-r--r-- | WebKit/android/jni/WebCoreJni.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/WebKit/android/jni/WebCoreJni.h b/WebKit/android/jni/WebCoreJni.h index 6e6a486..ec25c8f 100644 --- a/WebKit/android/jni/WebCoreJni.h +++ b/WebKit/android/jni/WebCoreJni.h @@ -36,6 +36,9 @@ namespace android { // returned from getRealObject. class AutoJObject { public: + AutoJObject(const AutoJObject& other) + : m_env(other.m_env) + , m_obj(other.m_obj ? other.m_env->NewLocalRef(other.m_obj) : NULL) {} ~AutoJObject() { if (m_obj) m_env->DeleteLocalRef(m_obj); @@ -54,6 +57,7 @@ public: return m_env; } private: + AutoJObject(); // Not permitted. AutoJObject(JNIEnv* env, jobject obj) : m_env(env) , m_obj(obj) {} |