diff --git a/source/mrviewerpy/MRPythonViewer.cpp b/source/mrviewerpy/MRPythonViewer.cpp index f7cbdf4377d2..55ac155f76fe 100644 --- a/source/mrviewerpy/MRPythonViewer.cpp +++ b/source/mrviewerpy/MRPythonViewer.cpp @@ -381,6 +381,8 @@ void shutViewerAtExit() } gViewerFinished.wait_for( std::chrono::seconds( 10 ) ); // a stuck loop must not hold the exit forever #else + if ( !gLaunchParams ) // the viewer was not launched by this module, e.g. Python embedded in an application + return; auto& viewer = getViewerInstance(); if ( viewer.isPreLaunched() ) postLaunchDefaultViewer( *gLaunchParams, *gLaunchSetup );