diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/EmulationActivity.java b/Source/Android/src/org/dolphinemu/dolphinemu/EmulationActivity.java index d41d13eee8..96d22184bf 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/EmulationActivity.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/EmulationActivity.java @@ -2,7 +2,6 @@ package org.dolphinemu.dolphinemu; import android.app.Activity; import android.app.AlertDialog; -import android.app.AlertDialog.Builder; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/NativeGLSurfaceView.java b/Source/Android/src/org/dolphinemu/dolphinemu/NativeGLSurfaceView.java index c508b1f810..8013856705 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/NativeGLSurfaceView.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/NativeGLSurfaceView.java @@ -35,7 +35,10 @@ public final class NativeGLSurfaceView extends SurfaceView { @Override public void run() { + NativeLibrary.Run(getHolder().getSurface()); + Created = false; + Running = false; } }; diff --git a/Source/Core/DolphinWX/Src/Android/ButtonManager.cpp b/Source/Core/DolphinWX/Src/Android/ButtonManager.cpp index d3aa1c2a93..1aa7187075 100644 --- a/Source/Core/DolphinWX/Src/Android/ButtonManager.cpp +++ b/Source/Core/DolphinWX/Src/Android/ButtonManager.cpp @@ -177,6 +177,8 @@ namespace ButtonManager delete *it; for (auto it = m_controllers.begin(); it != m_controllers.end(); ++it) delete it->second; + m_controllers.clear(); + m_buttons.clear(); } void DrawButtons() diff --git a/Source/Core/DolphinWX/Src/Android/ButtonManager.h b/Source/Core/DolphinWX/Src/Android/ButtonManager.h index bc5204d9bf..39b828efb7 100644 --- a/Source/Core/DolphinWX/Src/Android/ButtonManager.h +++ b/Source/Core/DolphinWX/Src/Android/ButtonManager.h @@ -118,7 +118,7 @@ namespace ButtonManager ~InputDevice() { for (auto it = m_binds.begin(); it != m_binds.end(); ++it) - delete it->second; + delete it->second; } void AddBind(sBind *bind) { m_binds[bind->m_buttontype] = bind; } void PressEvent(int button, int action); diff --git a/Source/Core/DolphinWX/Src/MainAndroid.cpp b/Source/Core/DolphinWX/Src/MainAndroid.cpp index 8fcab598cc..60413b74c5 100644 --- a/Source/Core/DolphinWX/Src/MainAndroid.cpp +++ b/Source/Core/DolphinWX/Src/MainAndroid.cpp @@ -199,7 +199,7 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_PauseEmulati JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_StopEmulation(JNIEnv *env, jobject obj) { - PowerPC::Stop(); + Core::Stop(); updateMainFrameEvent.Set(); // Kick the waiting event } JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onTouchEvent(JNIEnv *env, jobject obj, jint Action, jfloat X, jfloat Y) @@ -358,6 +358,7 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv * VideoBackend::ClearList(); SConfig::Shutdown(); LogManager::Shutdown(); + ANativeWindow_release(surf); } diff --git a/Source/Core/VideoCommon/Src/OnScreenDisplay.cpp b/Source/Core/VideoCommon/Src/OnScreenDisplay.cpp index b66c2019c9..90e5c008ef 100644 --- a/Source/Core/VideoCommon/Src/OnScreenDisplay.cpp +++ b/Source/Core/VideoCommon/Src/OnScreenDisplay.cpp @@ -84,6 +84,10 @@ void DoCallbacks(CallbackType type) { it->second(); } + + // Wipe all callbacks on shutdown + if (type == OSD_SHUTDOWN) + s_callbacks.clear(); } } // namespace