mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-22 18:17:25 -05:00
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:
parent
492128ef86
commit
8ad3563963
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user