--- sfx2/source/appl/shutdowniconw32.cxx
+++ sfx2/source/appl/shutdowniconw32.cxx
@@ -472,10 +472,15 @@ LRESULT CALLBACK listenerWndProc( HWND h
                             nid.hWnd = hWnd;
                             nid.uID = ID_QUICKSTART;
                             Shell_NotifyIconA(NIM_DELETE, &nid);
+							if( aExecuterWindow == NULL &&
+								aListenerWindow == NULL )
+								if ( !ShutdownIcon::bModalMode )
+									ShutdownIcon::terminateDesktop();
+								
                             break;
                     }
-
-					PostMessage( aExecuterWindow, WM_COMMAND, m, (LPARAM)hWnd );
+					if( aExecuterWindow != NULL )
+						PostMessage( aExecuterWindow, WM_COMMAND, m, (LPARAM)hWnd );
                 }
                 break;
             }
@@ -679,12 +684,13 @@ void win32_shutdown_sys_tray()
 	if ( ShutdownIcon::IsQuickstarterInstalled() )
 	{
 		if( IsWindow( aListenerWindow ) )
-		{
 			DestroyWindow( aListenerWindow );
-			aListenerWindow = NULL;
+		aListenerWindow = NULL;
+
+		if( IsWindow( aExecuterWindow ) )
 			DestroyWindow( aExecuterWindow );
-			aExecuterWindow = NULL;
-		}
+		aExecuterWindow = NULL;
+
 		UnregisterClassA( QUICKSTART_CLASSNAME, GetModuleHandle( NULL ) );
 		UnregisterClassA( EXECUTER_WINDOWCLASS, GetModuleHandle( NULL ) );
 	}
