Added logic to force orderly close of Qt TAS editor any time a ROM is closed or the application is quit.

This commit is contained in:
mjbudd77 2021-12-30 21:38:23 -05:00
parent 8ee625c473
commit 5fc47dce6a
4 changed files with 29 additions and 0 deletions

View File

@ -2113,6 +2113,11 @@ void consoleWin_t::closeApp(void)
aviDiskThread->quit();
aviDiskThread->wait( 10000 );
if ( tasWin != NULL )
{
tasWin->requestWindowClose();
}
FCEU_WRAPPER_LOCK();
fceuWrapperClose();
FCEU_WRAPPER_UNLOCK();

View File

@ -297,6 +297,7 @@ void TasEditorWindow::closeEvent(QCloseEvent *event)
event->ignore();
return;
}
project.reset();
done(0);
deleteLater();
@ -309,11 +310,26 @@ void TasEditorWindow::closeWindow(void)
{
return;
}
project.reset();
printf("Tas Editor Close Window\n");
done(0);
deleteLater();
}
//----------------------------------------------------------------------------
int TasEditorWindow::requestWindowClose(void)
{
askToSaveProject();
project.reset();
printf("Tas Editor Close Window\n");
done(0);
deleteLater();
return 0;
}
//----------------------------------------------------------------------------
QMenuBar *TasEditorWindow::buildMenuBar(void)
{
QMenu *fileMenu, *editMenu, *viewMenu,

View File

@ -411,6 +411,8 @@ class TasEditorWindow : public QDialog
bool handleInputColumnSetUsingPattern(int joy, int button);
bool updateHistoryItems(void);
int requestWindowClose(void);
QPoint getPreviewPopupCoordinates(void);
protected:

View File

@ -44,6 +44,7 @@
#include "Qt/ConsoleDebugger.h"
#include "Qt/ConsoleWindow.h"
#include "Qt/ConsoleUtilities.h"
#include "Qt/TasEditor/TasEditorWindow.h"
#include "Qt/fceux_git_info.h"
#include "common/cheat.h"
@ -483,6 +484,11 @@ CloseGame(void)
saveInputSettingsToFile();
}
if ( tasWin != NULL )
{
tasWin->requestWindowClose();
}
FCEUI_CloseGame();
DriverKill();