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: sergei's suggestions Created March 29, 2017, 2:07 p.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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libadblockplus-android/jni/JniLogSystem.cpp
diff --git a/libadblockplus-android/jni/JniLogSystem.cpp b/libadblockplus-android/jni/JniLogSystem.cpp
index d537a685bdc7dd7dc7fb10d64efcbed65aa3a5df..268dc2caa04295f4c1ddbd981eef90cb65138b48 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 AdblockPlus::LogSystemPtr(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<AdblockPlus::LogSystemPtr>(ptr);
}
JniLogSystemCallback::JniLogSystemCallback(JNIEnv* env, jobject callbackObject)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld