فهرست منبع

UI: Fix crash when receiving multiple SIGINT

When there are two or more SIGINT signals were sent to obs, obs crashes
because the 2nd SIGINT calls `close` though the main window has been
deleted.
Norihiro Kamae 2 سال پیش
والد
کامیت
cc667ad7d9
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      UI/obs-app.cpp

+ 2 - 1
UI/obs-app.cpp

@@ -3238,7 +3238,8 @@ void OBSApp::ProcessSigInt(void)
 	recv(sigintFd[1], &tmp, sizeof(tmp), 0);
 	recv(sigintFd[1], &tmp, sizeof(tmp), 0);
 
 
 	OBSBasic *main = reinterpret_cast<OBSBasic *>(GetMainWindow());
 	OBSBasic *main = reinterpret_cast<OBSBasic *>(GetMainWindow());
-	main->close();
+	if (main)
+		main->close();
 #endif
 #endif
 }
 }