diff options
-rw-r--r-- | vcl/unx/generic/app/saldata.cxx | 25 | ||||
-rw-r--r-- | vcl/unx/gtk/app/gtkdata.cxx | 11 |
2 files changed, 16 insertions, 20 deletions
diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx index 3d91586726f4..9b5e200ad221 100644 --- a/vcl/unx/generic/app/saldata.cxx +++ b/vcl/unx/generic/app/saldata.cxx @@ -307,22 +307,19 @@ int X11SalData::XErrorHdl( Display *pDisplay, XErrorEvent *pEvent ) int X11SalData::XIOErrorHdl( Display * ) { - if (::osl::Thread::getCurrentIdentifier() != Application::GetMainThreadIdentifier()) + if (::osl::Thread::getCurrentIdentifier() == Application::GetMainThreadIdentifier()) { - pthread_exit(NULL); - return 0; + /* #106197# hack: until a real shutdown procedure exists + * _exit ASAP + */ + if( ImplGetSVData()->maAppData.mbAppQuit ) + _exit(1); + + // really bad hack + if( ! SessionManagerClient::checkDocumentsSaved() ) + /* oslSignalAction eToDo = */ osl_raiseSignal (OSL_SIGNAL_USER_X11SUBSYSTEMERROR, NULL); } - /* #106197# hack: until a real shutdown procedure exists - * _exit ASAP - */ - if( ImplGetSVData()->maAppData.mbAppQuit ) - _exit(1); - - // really bad hack - if( ! SessionManagerClient::checkDocumentsSaved() ) - /* oslSignalAction eToDo = */ osl_raiseSignal (OSL_SIGNAL_USER_X11SUBSYSTEMERROR, NULL); - std::fprintf( stderr, "X IO Error\n" ); std::fflush( stdout ); std::fflush( stderr ); @@ -331,7 +328,7 @@ int X11SalData::XIOErrorHdl( Display * ) * do apply here. Since there is nothing to be done after an XIO * error we have to _exit immediately. */ - _exit(0); + _exit(1); return 0; } diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index 5ff5a8010f7a..0df6b10f370f 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -513,12 +513,11 @@ XIOErrorHandler aOrigXIOErrorHandler = NULL; int XIOErrorHdl(Display *pDisplay) { - if (::osl::Thread::getCurrentIdentifier() != Application::GetMainThreadIdentifier()) - { - pthread_exit(NULL); - return 0; - } - return aOrigXIOErrorHandler ? aOrigXIOErrorHandler(pDisplay) : 0; + if (aOrigXIOErrorHandler) + aOrigXIOErrorHandler(pDisplay); + _exit(1); + // avoid crashes in unrelated threads that still run while atexit + // handlers are in progress } GtkData::~GtkData() |