Skip to content

Commit b58610a

Browse files
committed
Fix crash when hiding Mask checkbox.
1 parent e2ebfdf commit b58610a

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

SerialPrograms/Source/NintendoSwitch/Framework/UI/NintendoSwitch_CommandRow.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,11 @@ CommandRow::CommandRow(
7474
m_overlay_text->setChecked(session.enabled_text());
7575
row->addWidget(m_overlay_text);
7676

77-
if (PreloadSettings::instance().DEVELOPER_MODE){
78-
m_overlay_images = new QCheckBox("Masks", this);
79-
m_overlay_images->setChecked(session.enabled_images());
80-
row->addWidget(m_overlay_images);
77+
m_overlay_images = new QCheckBox("Masks", this);
78+
m_overlay_images->setChecked(session.enabled_images());
79+
row->addWidget(m_overlay_images);
80+
if (!PreloadSettings::instance().DEVELOPER_MODE){
81+
m_overlay_images->setVisible(false);
8182
}
8283

8384
m_overlay_log = new QCheckBox("Log", this);

SerialPrograms/Source/NintendoSwitch/Framework/UI/NintendoSwitch_CommandRow.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,19 @@ class CommandRow :
6565
ControllerSession& m_controller;
6666
VideoOverlaySession& m_session;
6767
bool m_allow_commands_while_running;
68-
QComboBox* m_command_box;
69-
QLabel* m_status;
68+
QComboBox* m_command_box = nullptr;
69+
QLabel* m_status = nullptr;
7070

71-
QCheckBox* m_overlay_log;
72-
QCheckBox* m_overlay_text;
73-
QCheckBox* m_overlay_images;
74-
QCheckBox* m_overlay_boxes;
75-
QCheckBox* m_overlay_stats;
71+
QCheckBox* m_overlay_log = nullptr;
72+
QCheckBox* m_overlay_text = nullptr;
73+
QCheckBox* m_overlay_images = nullptr;
74+
QCheckBox* m_overlay_boxes = nullptr;
75+
QCheckBox* m_overlay_stats = nullptr;
7676

77-
QPushButton* m_load_profile_button;
78-
QPushButton* m_save_profile_button;
79-
QPushButton* m_screenshot_button;
80-
QPushButton* m_video_button;
77+
QPushButton* m_load_profile_button = nullptr;
78+
QPushButton* m_save_profile_button = nullptr;
79+
QPushButton* m_screenshot_button = nullptr;
80+
QPushButton* m_video_button = nullptr;
8181
bool m_last_known_focus;
8282
ProgramState m_last_known_state;
8383
};

0 commit comments

Comments
 (0)