From b1017660ecac2d0f3755544f394238fea0fc71ff Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 1 Jun 2010 11:30:19 +0200 Subject: vcl112: #i111972# avoid sshutdown problems in default ICE IO error handler (thanks cmc!) --- vcl/unx/source/app/sm.cxx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'vcl/unx/source') diff --git a/vcl/unx/source/app/sm.cxx b/vcl/unx/source/app/sm.cxx index dbaa278a780b..959d6af5912d 100644 --- a/vcl/unx/source/app/sm.cxx +++ b/vcl/unx/source/app/sm.cxx @@ -159,6 +159,10 @@ class ICEConnectionObserver static int nWakeupFiles[2]; static oslMutex ICEMutex; static oslThread ICEThread; +#ifdef USE_SM_EXTENSION + static IceIOErrorHandler origIOErrorHandler; + static IceErrorHandler origErrorHandler; +#endif public: static void activate(); @@ -179,6 +183,19 @@ oslMutex ICEConnectionObserver::ICEMutex = NULL; oslThread ICEConnectionObserver::ICEThread = NULL; int ICEConnectionObserver::nWakeupFiles[2] = { 0, 0 }; +#ifdef USE_SM_EXTENSION +IceIOErrorHandler ICEConnectionObserver::origIOErrorHandler = NULL; +IceErrorHandler ICEConnectionObserver::origErrorHandler = NULL; + +static void IgnoreIceErrors(IceConn, Bool, int, unsigned long, int, int, IcePointer) +{ +} + +static void IgnoreIceIOErrors(IceConn) +{ +} +#endif + // HACK bool SessionManagerClient::bDocSaveDone = false; @@ -591,6 +608,12 @@ void ICEConnectionObserver::activate() ICEMutex = osl_createMutex(); bIsWatching = TRUE; #ifdef USE_SM_EXTENSION + /* + * Default handlers call exit, we don't care that strongly if something + * happens to fail + */ + origIOErrorHandler = IceSetIOErrorHandler( IgnoreIceIOErrors ); + origErrorHandler = IceSetErrorHandler( IgnoreIceErrors ); IceAddConnectionWatch( ICEWatchProc, NULL ); #endif } @@ -604,6 +627,8 @@ void ICEConnectionObserver::deactivate() bIsWatching = FALSE; #ifdef USE_SM_EXTENSION IceRemoveConnectionWatch( ICEWatchProc, NULL ); + IceSetErrorHandler( origErrorHandler ); + IceSetIOErrorHandler( origIOErrorHandler ); #endif nConnections = 0; if( ICEThread ) -- cgit