Always call obs_remove_tick_callback() in destructor

Seems like in some scenarios a screenshot thread would still be active
while the ScreenshotHelper object was deleted
This commit is contained in:
WarmUpTill 2023-01-30 20:56:25 +01:00 committed by WarmUpTill
parent 492128ef86
commit 8ad3563963
2 changed files with 2 additions and 3 deletions

View File

@ -39,9 +39,8 @@ ScreenshotHelper::~ScreenshotHelper()
gs_stagesurface_destroy(stagesurf);
gs_texrender_destroy(texrender);
obs_leave_graphics();
obs_remove_tick_callback(ScreenshotTick, this);
}
obs_remove_tick_callback(ScreenshotTick, this);
if (_saveThread.joinable()) {
_saveThread.join();
}

View File

@ -36,7 +36,7 @@ public:
std::chrono::high_resolution_clock::time_point time;
private:
bool _initDone = false;
std::atomic_bool _initDone = false;
bool _blocking = false;
std::thread _saveThread;
bool _saveToFile = false;