mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 967553 - Restore to using __wrap_free. r=gcp
This commit is contained in:
parent
42e775a64c
commit
ac3708bb75
@ -13,13 +13,6 @@
|
|||||||
|
|
||||||
#include "ElfLoader.h"
|
#include "ElfLoader.h"
|
||||||
|
|
||||||
#ifdef MOZ_MEMORY
|
|
||||||
// libc's free().
|
|
||||||
extern "C" void __real_free(void *);
|
|
||||||
#else
|
|
||||||
#define __real_free(a) free(a)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#define LOG(x...) __android_log_print(ANDROID_LOG_INFO, "GeckoJNI", x)
|
#define LOG(x...) __android_log_print(ANDROID_LOG_INFO, "GeckoJNI", x)
|
||||||
#else
|
#else
|
||||||
@ -91,8 +84,7 @@ throwError(JNIEnv* jenv, const char * funcString) {
|
|||||||
LOG("Throwing error: %s\n", msg);
|
LOG("Throwing error: %s\n", msg);
|
||||||
|
|
||||||
JNI_Throw(jenv, "java/lang/Exception", msg);
|
JNI_Throw(jenv, "java/lang/Exception", msg);
|
||||||
// msg is allocated by asprintf, it needs to be freed by libc.
|
free(msg);
|
||||||
__real_free(msg);
|
|
||||||
LOG("Error thrown\n");
|
LOG("Error thrown\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,13 +11,6 @@
|
|||||||
#include "ElfLoader.h"
|
#include "ElfLoader.h"
|
||||||
#include "SQLiteBridge.h"
|
#include "SQLiteBridge.h"
|
||||||
|
|
||||||
#ifdef MOZ_MEMORY
|
|
||||||
// libc's free().
|
|
||||||
extern "C" void __real_free(void *);
|
|
||||||
#else
|
|
||||||
#define __real_free(a) free(a)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#define LOG(x...) __android_log_print(ANDROID_LOG_INFO, "GeckoJNI", x)
|
#define LOG(x...) __android_log_print(ANDROID_LOG_INFO, "GeckoJNI", x)
|
||||||
#else
|
#else
|
||||||
@ -85,8 +78,7 @@ static void throwSqliteException(JNIEnv* jenv, const char* aFormat, ...)
|
|||||||
vasprintf(&msg, aFormat, ap);
|
vasprintf(&msg, aFormat, ap);
|
||||||
LOG("Error in SQLiteBridge: %s\n", msg);
|
LOG("Error in SQLiteBridge: %s\n", msg);
|
||||||
JNI_Throw(jenv, "org/mozilla/gecko/sqlite/SQLiteBridgeException", msg);
|
JNI_Throw(jenv, "org/mozilla/gecko/sqlite/SQLiteBridgeException", msg);
|
||||||
// msg is allocated by vasprintf, it needs to be freed by libc.
|
free(msg);
|
||||||
__real_free(msg);
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user