From 19a0afe5268f55cf360b8c6ce324991ae92ea5cc Mon Sep 17 00:00:00 2001 From: gxalpha Date: Sun, 19 Feb 2023 13:57:14 +0100 Subject: [PATCH] UI: Don't double-delete children of deleted widgets These widgets are all children of updateSettingsGroupBox, meaning they get deleted when updateSettingsGroupBox gets deleted. This means that the first two calls are unnecessary and the third one segfaults as updateChannelLabel is gone already. Just delete the parent widget instead. --- UI/window-basic-settings.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp index e51d88ce3..f97eb8978 100644 --- a/UI/window-basic-settings.cpp +++ b/UI/window-basic-settings.cpp @@ -577,14 +577,11 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent) ui->advOutFFABitrate->setSuffix(" Kbps"); #if !defined(_WIN32) && !defined(__APPLE__) - delete ui->enableAutoUpdates; - ui->enableAutoUpdates = nullptr; - delete ui->updateChannelBox; - ui->updateChannelBox = nullptr; delete ui->updateSettingsGroupBox; ui->updateSettingsGroupBox = nullptr; - delete ui->updateChannelLabel; ui->updateChannelLabel = nullptr; + ui->updateChannelBox = nullptr; + ui->enableAutoUpdates = nullptr; #else // Hide update section if disabled if (App()->IsUpdaterDisabled())