From 2f07107e882149989d3ade2c230e98ceccc34bdc Mon Sep 17 00:00:00 2001 From: Exeldro Date: Thu, 12 Aug 2021 22:16:25 +0200 Subject: [PATCH] frontend-tools: Fix crash on shutdown --- UI/frontend-plugins/frontend-tools/scripts.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/UI/frontend-plugins/frontend-tools/scripts.cpp b/UI/frontend-plugins/frontend-tools/scripts.cpp index d83437f30..b26c2b669 100644 --- a/UI/frontend-plugins/frontend-tools/scripts.cpp +++ b/UI/frontend-plugins/frontend-tools/scripts.cpp @@ -568,9 +568,15 @@ static void obs_event(enum obs_frontend_event event, void *) delete scriptsWindow; delete scriptLogWindow; + scriptData = nullptr; + scriptsWindow = nullptr; + scriptLogWindow = nullptr; + } else if (event == OBS_FRONTEND_EVENT_SCENE_COLLECTION_CLEANUP) { - scriptLogWindow->hide(); - scriptLogWindow->Clear(); + if (scriptLogWindow) { + scriptLogWindow->hide(); + scriptLogWindow->Clear(); + } delete scriptData; scriptData = new ScriptData;