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
a959e8f491
commit
f52fb57d99
@ -13,13 +13,6 @@
|
||||
|
||||
#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
|
||||
#define LOG(x...) __android_log_print(ANDROID_LOG_INFO, "GeckoJNI", x)
|
||||
#else
|
||||
@ -91,8 +84,7 @@ throwError(JNIEnv* jenv, const char * funcString) {
|
||||
LOG("Throwing error: %s\n", msg);
|
||||
|
||||
JNI_Throw(jenv, "java/lang/Exception", msg);
|
||||
// msg is allocated by asprintf, it needs to be freed by libc.
|
||||
__real_free(msg);
|
||||
free(msg);
|
||||
LOG("Error thrown\n");
|
||||
}
|
||||
|
||||
|
@ -11,13 +11,6 @@
|
||||
#include "ElfLoader.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
|
||||
#define LOG(x...) __android_log_print(ANDROID_LOG_INFO, "GeckoJNI", x)
|
||||
#else
|
||||
@ -85,8 +78,7 @@ static void throwSqliteException(JNIEnv* jenv, const char* aFormat, ...)
|
||||
vasprintf(&msg, aFormat, ap);
|
||||
LOG("Error in SQLiteBridge: %s\n", msg);
|
||||
JNI_Throw(jenv, "org/mozilla/gecko/sqlite/SQLiteBridgeException", msg);
|
||||
// msg is allocated by vasprintf, it needs to be freed by libc.
|
||||
__real_free(msg);
|
||||
free(msg);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user