File tree Expand file tree Collapse file tree
src/OpenCOVER/plugins/general/WindowTypeQt Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -456,8 +456,10 @@ bool WindowTypeQtPlugin::windowCreate(int i)
456456
457457 // std::cerr << "window " << i << ": ctx=" << coVRConfig::instance()->windows[i].context << std::endl;
458458
459- qApp->sendPostedEvents ();
460- qApp->processEvents ();
459+ if (qApp)
460+ qApp->sendPostedEvents ();
461+ if (qApp)
462+ qApp->processEvents ();
461463
462464 return true ;
463465}
@@ -495,10 +497,9 @@ void WindowTypeQtPlugin::aboutCover() const
495497void WindowTypeQtPlugin::windowCheckEvents (int num)
496498{
497499 if (qApp)
498- {
499500 qApp->sendPostedEvents ();
501+ if (qApp)
500502 qApp->processEvents ();
501- }
502503}
503504
504505void WindowTypeQtPlugin::windowUpdateContents (int num)
@@ -534,15 +535,20 @@ void WindowTypeQtPlugin::windowDestroy(int num)
534535 }
535536 delete win.widget ;
536537 delete win.window ;
537- qApp->sendPostedEvents ();
538- qApp->processEvents ();
538+ if (qApp)
539+ qApp->sendPostedEvents ();
540+ if (qApp)
541+ qApp->processEvents ();
539542 m_windows.erase (it);
540543
541544 if (m_deleteQApp && m_windows.empty ())
542545 {
543- qApp->quit ();
544- qApp->sendPostedEvents ();
545- qApp->processEvents ();
546+ if (qApp)
547+ qApp->quit ();
548+ if (qApp)
549+ qApp->sendPostedEvents ();
550+ if (qApp)
551+ qApp->processEvents ();
546552 delete qApp;
547553 }
548554}
You can’t perform that action at this time.
0 commit comments