mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-10-20 21:14:58 -04:00
UI: Destroy save timer before closing main window
This prevents the save timer from unexpectedly going off during the middle of the save process.
This commit is contained in:
1 parent
7014076169
commit
c4ef2522ad
2 files changed
+10
-5
No files matched your search
@@ -653,15 +653,13 @@ void OBSBasic::OBSInit()
|
||||
TimedCheckForUpdates();
|
||||
loaded = true;
|
||||
|
||||
QTimer *timer = new QTimer(this);
|
||||
connect(timer, SIGNAL(timeout()), this, SLOT(SaveProject()));
|
||||
timer->start(20000);
|
||||
saveTimer = new QTimer(this);
|
||||
connect(saveTimer, SIGNAL(timeout()), this, SLOT(SaveProject()));
|
||||
saveTimer->start(20000);
|
||||
}
|
||||
|
||||
OBSBasic::~OBSBasic()
|
||||
{
|
||||
SaveProject();
|
||||
|
||||
/* XXX: any obs data must be released before calling obs_shutdown.
|
||||
* currently, we can't automate this with C++ RAII because of the
|
||||
* delicate nature of obs_shutdown needing to be freed before the UI
|
||||
@@ -1659,6 +1657,11 @@ void OBSBasic::closeEvent(QCloseEvent *event)
|
||||
// remove draw callback in case our drawable surfaces go away before
|
||||
// the destructor gets called
|
||||
obs_remove_draw_callback(OBSBasic::RenderMain, this);
|
||||
|
||||
/* Delete the save timer so it doesn't trigger after this point while
|
||||
* the program data is being freed */
|
||||
delete saveTimer;
|
||||
SaveProject();
|
||||
}
|
||||
|
||||
void OBSBasic::changeEvent(QEvent *event)
|
||||
|
||||
Reference in new issue
Block a user