Skip to content

Commit 569643e

Browse files
Removing a selectable property no longer asks for confirmation on macOS due to a still unsolved crash
1 parent 870626e commit 569643e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

FEBioStudio/FEClassPropsView.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,21 @@ void CPropertySelector::onSelectionChanged(int n)
8080
int m = currentData().toInt();
8181
if (m == -2)
8282
{
83+
// Strange bug on macOS is causing crashes here. For some reason, this object is getting deleted before the
84+
// QMessageBox is closing. We have tried manually instantiating a QMessageBox and even making our own custom
85+
// dialog to ask the question, and neither fixes the problem despite the fact that in the m==-3 case, we're
86+
// also opening a custom dialog, and that works without any issues (with this object's destructor running
87+
// after this function exits as expected).
88+
#ifndef __APPLE__
8389
QString title = QString("Remove %1").arg(QString::fromStdString(m_pp->GetLongName()));
8490
if (QMessageBox::question(this, title, "Are you sure you want to remove this property?", QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
8591
{
8692
emit currentDataChanged(n);
8793
}
8894
else setCurrentIndex(0);
95+
#else
96+
emit currentDataChanged(n);
97+
#endif
8998
}
9099
else if (m == -3)
91100
{

0 commit comments

Comments
 (0)