From 960958a4ca8eb365bb63efd7e34c547973e67207 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Tue, 25 Jul 2017 19:01:29 -0700 Subject: [PATCH] UI: Fix potential crash when outputs change If the service settings change and the output type changes, the previous signals would attempt to disconnect after the output has been destroyed, and subsequently that would cause a crash. --- UI/window-basic-main-outputs.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/UI/window-basic-main-outputs.cpp b/UI/window-basic-main-outputs.cpp index ea4f67216..2b69112ba 100644 --- a/UI/window-basic-main-outputs.cpp +++ b/UI/window-basic-main-outputs.cpp @@ -662,6 +662,11 @@ bool SimpleOutput::StartStreaming(obs_service_t *service) /* XXX: this is messy and disgusting and should be refactored */ if (outputType != type) { + streamDelayStarting.Disconnect(); + streamStopping.Disconnect(); + startStreaming.Disconnect(); + stopStreaming.Disconnect(); + streamOutput = obs_output_create(type, "simple_stream", nullptr, nullptr); if (!streamOutput) @@ -1349,6 +1354,11 @@ bool AdvancedOutput::StartStreaming(obs_service_t *service) /* XXX: this is messy and disgusting and should be refactored */ if (outputType != type) { + streamDelayStarting.Disconnect(); + streamStopping.Disconnect(); + startStreaming.Disconnect(); + stopStreaming.Disconnect(); + streamOutput = obs_output_create(type, "adv_stream", nullptr, nullptr); if (!streamOutput)