Navigation Menu

Skip to content

Commit

Permalink
take III on #5597
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed May 23, 2012
1 parent b600ff7 commit 860f66d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 0 additions & 5 deletions src/app/qgscustomization.cpp
Expand Up @@ -857,11 +857,6 @@ void QgsCustomization::removeFromLayout( QLayout *theLayout, QWidget * theWidget

void QgsCustomization::preNotify( QObject * receiver, QEvent * event, bool * done )
{
// Crashes especially on Mac if we're not in the main/UI thread, see #5597
if ( QCoreApplication::instance()->thread() != QThread::currentThread() )
{
return;
}
if ( event->type() == QEvent::Show || event->type() == QEvent::MouseButtonPress )
{
QWidget *widget = qobject_cast<QWidget*>( receiver );
Expand Down
4 changes: 3 additions & 1 deletion src/core/qgsapplication.cpp
Expand Up @@ -200,7 +200,9 @@ bool QgsApplication::event( QEvent * event )
bool QgsApplication::notify( QObject * receiver, QEvent * event )
{
bool done = false;
emit preNotify( receiver, event, &done );
// Crashes in customization (especially on Mac), if we're not in the main/UI thread, see #5597
if ( thread() == receiver->thread() )
emit preNotify( receiver, event, &done );

if ( done )
return true;
Expand Down

0 comments on commit 860f66d

Please sign in to comment.