# HG changeset patch # Parent a1e8a1f400fc22e9e323e08362d021fa10018e62 check if frame is alive before using it diff -r a1e8a1f400fc framework/source/dispatch/closedispatcher.cxx --- a/framework/source/dispatch/closedispatcher.cxx Wed May 05 10:54:02 2010 +0200 +++ b/framework/source/dispatch/closedispatcher.cxx Fri May 07 13:00:56 2010 +0200 @@ -382,6 +382,8 @@ // Do it now ... sal_Bool bSuccess = sal_False; + css::uno::WeakReference wCloseFrame(xCloseFrame); + xCloseFrame.set(0); if (bCloseFrame) bSuccess = implts_closeFrame(); else @@ -417,9 +419,14 @@ if (bTerminateApp) bSuccess = implts_terminateApplication(); + // implts_terminateApplication() may end by disposing frames without + // actually quitting the application--if quickstarter is running, + // for example. Ensure that the frame is still alive before using it. + xCloseFrame = wCloseFrame; if ( ( ! bSuccess ) && - ( bControllerSuspended ) + ( bControllerSuspended ) && + ( xCloseFrame.is() ) ) { css::uno::Reference< css::frame::XController > xController = xCloseFrame->getController();