Skip to content

Commit

Permalink
Gui: Fix crash in DlgSettingsLightSources
Browse files Browse the repository at this point in the history
  • Loading branch information
chennes authored and adrianinsaval committed Aug 9, 2024
1 parent 8339bd9 commit 362cf1c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Gui/PreferencePages/DlgSettingsLightSources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ DlgSettingsLightSources::DlgSettingsLightSources(QWidget* parent)

DlgSettingsLightSources::~DlgSettingsLightSources()
{
delete view;
}

void DlgSettingsLightSources::setupConnection()
Expand All @@ -73,14 +72,16 @@ void DlgSettingsLightSources::setupConnection()
void DlgSettingsLightSources::showEvent(QShowEvent* event)
{
Q_UNUSED(event)
if (!view) {
static bool underConstruction = false; // Prevent recursion
if (!underConstruction && !view) {
underConstruction = true;
QGroupBox* box = ui->groupBoxLight;
QWidget* widget = createViewer(box);
auto grid = new QGridLayout(box);
grid->addWidget(widget);
box->setLayout(grid);

loadDirection();
underConstruction = false;
}
}

Expand Down

0 comments on commit 362cf1c

Please sign in to comment.