Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Android] Fix the ability to stop the game and start another.
  • Loading branch information
Sonicadvance1 committed Sep 23, 2013
1 parent bab9149 commit 96a77f9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 3 deletions.
Expand Up @@ -2,7 +2,6 @@

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;
Expand Down
Expand Up @@ -35,7 +35,10 @@ public NativeGLSurfaceView(Context context, AttributeSet attribs)
{
@Override
public void run() {

NativeLibrary.Run(getHolder().getSurface());
Created = false;
Running = false;
}
};

Expand Down
2 changes: 2 additions & 0 deletions Source/Core/DolphinWX/Src/Android/ButtonManager.cpp
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/Src/Android/ButtonManager.h
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/DolphinWX/Src/MainAndroid.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -358,6 +358,7 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *
VideoBackend::ClearList();
SConfig::Shutdown();
LogManager::Shutdown();
ANativeWindow_release(surf);
}


Expand Down
4 changes: 4 additions & 0 deletions Source/Core/VideoCommon/Src/OnScreenDisplay.cpp
Expand Up @@ -84,6 +84,10 @@ void DoCallbacks(CallbackType type)
{
it->second();
}

// Wipe all callbacks on shutdown
if (type == OSD_SHUTDOWN)
s_callbacks.clear();
}

} // namespace

0 comments on commit 96a77f9

Please sign in to comment.