Преглед на файлове

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.
gxalpha преди 2 години
родител
ревизия
19a0afe526
променени са 1 файла, в които са добавени 2 реда и са изтрити 5 реда
  1. 2 5
      UI/window-basic-settings.cpp

+ 2 - 5
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())