From 9f94294d80e904a7d7af51bdf8fe8fb9456b6832 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Sat, 22 Oct 2016 21:02:03 +0100 Subject: GUI: Fix incorrect initialisation of some tab Ids in OptionsDialog A value of 0 is valid for tab ids, so the correct initialisation at this stage is -1. However only one constructor properly initialized all the tab ids to -1 in its initialisation list, but it was then changed to 0 in init(). I have added the missing ones to the other constructors and removed the incorrect ones in init(). But maybe all tab ids should be initialised in init() rather than in the constructors initialisation lists. --- gui/options.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gui') diff --git a/gui/options.cpp b/gui/options.cpp index 4ebb60b18d..3701369316 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -122,7 +122,7 @@ OptionsDialog::OptionsDialog(const Common::String &domain, int x, int y, int w, } OptionsDialog::OptionsDialog(const Common::String &domain, const Common::String &name) - : Dialog(name), _domain(domain), _graphicsTabId(-1), _tabWidget(0) { + : Dialog(name), _domain(domain), _graphicsTabId(-1), _midiTabId(-1), _pathsTabId(-1), _tabWidget(0) { init(); } @@ -140,7 +140,6 @@ void OptionsDialog::init() { _filteringCheckbox = 0; _aspectCheckbox = 0; _enableAudioSettings = false; - _midiTabId = 0; _midiPopUp = 0; _midiPopUpDesc = 0; _oplPopUp = 0; @@ -183,7 +182,6 @@ void OptionsDialog::init() { _subSpeedSlider = 0; _subSpeedLabel = 0; - _pathsTabId = 0; _oldTheme = g_gui.theme()->getThemeId(); // Retrieve game GUI options -- cgit v1.2.3