From 92e5036eb6454ddde7ca328765054ef86e4ddcfc Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 20 Dec 2012 13:25:09 +0100 Subject: [PATCH] Disable onLowMemory callback - after this has executed, it would call Dalvik's garbage collector - definitely want to avoid that --- android/native/jni/main.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/android/native/jni/main.c b/android/native/jni/main.c index 3eb9f190e0..a245d96bed 100644 --- a/android/native/jni/main.c +++ b/android/native/jni/main.c @@ -594,13 +594,6 @@ static void onConfigurationChanged(ANativeActivity* activity) android_app_write_cmd(android_app, APP_CMD_CONFIG_CHANGED); } -static void onLowMemory(ANativeActivity* activity) -{ - struct android_app* android_app = (struct android_app*)activity->instance; - RARCH_LOG("LowMemory: %p\n", activity); - android_app_write_cmd(android_app, APP_CMD_LOW_MEMORY); -} - static void onWindowFocusChanged(ANativeActivity* activity, int focused) { RARCH_LOG("WindowFocusChanged: %p -- %d\n", activity, focused); @@ -649,7 +642,7 @@ void ANativeActivity_onCreate(ANativeActivity* activity, activity->callbacks->onPause = onPause; activity->callbacks->onStop = onStop; activity->callbacks->onConfigurationChanged = onConfigurationChanged; - activity->callbacks->onLowMemory = onLowMemory; + activity->callbacks->onLowMemory = NULL; activity->callbacks->onWindowFocusChanged = onWindowFocusChanged; activity->callbacks->onNativeWindowCreated = onNativeWindowCreated; activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed;