Permalink
Browse files
Qt: Fix loading game when game is loaded
- Loading branch information...
Showing
with
9 additions
and
6 deletions.
-
+9
−6
src/platform/qt/Window.cpp
|
|
@@ -737,6 +737,7 @@ void Window::gameStarted() { |
|
|
}
|
|
|
|
|
|
void Window::gameStopped() {
|
|
|
+ m_controller.reset();
|
|
|
#ifdef M_CORE_GBA
|
|
|
for (QAction* action : m_gbaActions) {
|
|
|
action->setDisabled(false);
|
|
|
@@ -1807,15 +1808,17 @@ void Window::setController(CoreController* controller, const QString& fname) { |
|
|
if (!controller) {
|
|
|
return;
|
|
|
}
|
|
|
- if (!fname.isEmpty()) {
|
|
|
- setWindowFilePath(fname);
|
|
|
- appendMRU(fname);
|
|
|
- }
|
|
|
|
|
|
if (m_controller) {
|
|
|
- m_controller->disconnect(this);
|
|
|
m_controller->stop();
|
|
|
- m_controller.reset();
|
|
|
+ QTimer::singleShot(0, this, [this, controller, fname]() {
|
|
|
+ setController(controller, fname);
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!fname.isEmpty()) {
|
|
|
+ setWindowFilePath(fname);
|
|
|
+ appendMRU(fname);
|
|
|
}
|
|
|
|
|
|
m_controller = std::shared_ptr<CoreController>(controller);
|
|
|
|
0 comments on commit
0ae51f4