Browse Source

frontend-tools: Fix crash on shutdown

Exeldro 4 years ago
parent
commit
2f07107e88
1 changed files with 8 additions and 2 deletions
  1. 8 2
      UI/frontend-plugins/frontend-tools/scripts.cpp

+ 8 - 2
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;