Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: libadblockplus-android/jni/JniLogSystem.cpp

Issue 29397600: Issue 5031 - Avoid double deletion of C++ objects (Closed)
Patch Set: Created March 29, 2017, 11:02 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: libadblockplus-android/jni/JniLogSystem.cpp
diff --git a/libadblockplus-android/jni/JniLogSystem.cpp b/libadblockplus-android/jni/JniLogSystem.cpp
index d537a685bdc7dd7dc7fb10d64efcbed65aa3a5df..6f78e33a6e3a611308b4a06aea6a0dbc8814d5af 100644
--- a/libadblockplus-android/jni/JniLogSystem.cpp
+++ b/libadblockplus-android/jni/JniLogSystem.cpp
@@ -39,14 +39,14 @@ static jlong JNICALL JniCtor(JNIEnv* env, jclass clazz, jobject callbackObject)
{
try
{
- return JniPtrToLong(new JniLogSystemCallback(env, callbackObject));
+ return JniPtrToLong(new JniLogSystemCallbackPtr(new JniLogSystemCallback(env, callbackObject)));
}
CATCH_THROW_AND_RETURN(env, 0)
}
static void JNICALL JniDtor(JNIEnv* env, jclass clazz, jlong ptr)
{
- delete JniLongToTypePtr<JniLogSystemCallback>(ptr);
+ delete JniLongToTypePtr<JniLogSystemCallbackPtr>(ptr);
}
JniLogSystemCallback::JniLogSystemCallback(JNIEnv* env, jobject callbackObject)
« libadblockplus-android/jni/JniCallbacks.h ('K') | « libadblockplus-android/jni/JniCallbacks.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld