Skip to content

Commit b600ff7

Browse files
committed
another take on #5597
1 parent f998a44 commit b600ff7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/app/qgscustomization.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <QToolButton>
3636
#include <QStatusBar>
3737
#include <QMetaObject>
38+
#include <QThread>
3839

3940
#ifdef Q_OS_MACX
4041
QgsCustomizationDialog::QgsCustomizationDialog( QWidget *parent )
@@ -856,8 +857,8 @@ void QgsCustomization::removeFromLayout( QLayout *theLayout, QWidget * theWidget
856857

857858
void QgsCustomization::preNotify( QObject * receiver, QEvent * event, bool * done )
858859
{
859-
// Crashes especially on Mac if the reciever is in another thread, see #5597
860-
if ( QCoreApplication::instance()->thread() != receiver->thread() )
860+
// Crashes especially on Mac if we're not in the main/UI thread, see #5597
861+
if ( QCoreApplication::instance()->thread() != QThread::currentThread() )
861862
{
862863
return;
863864
}

0 commit comments

Comments
 (0)