mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-14 21:31:45 -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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user