Changeset 26439 in vbox
- Timestamp:
- Feb 11, 2010 3:38:12 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends
- Files:
-
- 2 edited
-
VBoxHeadless/VBoxHeadless.cpp (modified) (3 diffs)
-
VBoxSDL/VBoxSDL.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r26322 r26439 832 832 ComPtr<ISession> session; 833 833 bool fSessionOpened = false; 834 VirtualBoxCallback *vboxCallback = NULL; 834 835 835 836 do … … 1018 1019 1019 1020 /* VirtualBox callback registration. */ 1020 VirtualBoxCallback *vboxCallback = new VirtualBoxCallback();1021 vboxCallback = new VirtualBoxCallback(); 1021 1022 vboxCallback->AddRef(); 1022 1023 CHECK_ERROR(virtualBox, RegisterCallback(vboxCallback)); … … 1142 1143 while (0); 1143 1144 1145 /* VirtualBox callback unregistration. */ 1146 if (vboxCallback) 1147 { 1148 vboxCallback->AddRef(); 1149 CHECK_ERROR(virtualBox, UnregisterCallback(vboxCallback)); 1150 vboxCallback->Release(); 1151 } 1152 1144 1153 /* No more access to the 'console' object, which will be uninitialized by the next session->Close call. */ 1145 1154 gConsole = NULL; -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r26429 r26439 1393 1393 } 1394 1394 1395 do 1395 /* NOTE: do not convert the following scope to a "do {} while (0);", as 1396 * this would make it all too tempting to use "break;" incorrectly - it 1397 * would skip over the cleanup. */ 1396 1398 { 1397 1399 // scopes all the stuff till shutdown … … 1401 1403 ComPtr <ISession> session; 1402 1404 bool sessionOpened = false; 1405 EventQueue* eventQ = com::EventQueue::getMainEventQueue(); 1403 1406 1404 1407 rc = virtualBox.createLocalObject (CLSID_VirtualBox); … … 1411 1414 else 1412 1415 RTPrintf("Failed to create VirtualBox object! No error information available (rc = 0x%x).\n", rc); 1413 break;1416 goto leave; 1414 1417 } 1415 1418 rc = session.createInprocObject (CLSID_Session); … … 1417 1420 { 1418 1421 RTPrintf("Failed to create session object, rc = 0x%x!\n", rc); 1419 break; 1420 } 1421 1422 EventQueue* eventQ = com::EventQueue::getMainEventQueue(); 1422 goto leave; 1423 } 1423 1424 1424 1425 /* … … 1752 1753 1753 1754 ComPtr<ISnapshot> pCurrentSnapshot; 1754 CHECK_ERROR_BREAK(gMachine, COMGETTER(CurrentSnapshot)(pCurrentSnapshot.asOutParam())); 1755 CHECK_ERROR(gMachine, COMGETTER(CurrentSnapshot)(pCurrentSnapshot.asOutParam())); 1756 if (FAILED(rc)) 1757 goto leave; 1755 1758 1756 1759 CHECK_ERROR(gConsole, RestoreSnapshot(pCurrentSnapshot, gProgress.asOutParam())); … … 2757 2760 ) 2758 2761 ) 2762 do 2759 2763 { 2760 2764 cbConsoleImpl->ignorePowerOffEvents(true); 2761 ComPtr <IProgress> progress;2765 ComPtr<IProgress> progress; 2762 2766 CHECK_ERROR_BREAK(gConsole, PowerDown(progress.asOutParam())); 2763 CHECK_ERROR_BREAK (progress, WaitForCompletion(-1));2767 CHECK_ERROR_BREAK(progress, WaitForCompletion(-1)); 2764 2768 BOOL completed; 2765 CHECK_ERROR_BREAK (progress, COMGETTER(Completed)(&completed));2769 CHECK_ERROR_BREAK(progress, COMGETTER(Completed)(&completed)); 2766 2770 ASSERT (completed); 2767 2771 LONG hrc; 2768 CHECK_ERROR_BREAK (progress, COMGETTER(ResultCode)(&hrc));2772 CHECK_ERROR_BREAK(progress, COMGETTER(ResultCode)(&hrc)); 2769 2773 if (FAILED(hrc)) 2770 2774 { … … 2777 2781 break; 2778 2782 } 2779 } 2783 } while (0); 2780 2784 2781 2785 /* … … 2866 2870 RTLdrClose(gLibrarySDL_ttf); 2867 2871 #endif 2872 2873 /* VirtualBox callback unregistration. */ 2874 if (!virtualBox.isNull() && !callback.isNull()) 2875 virtualBox->UnregisterCallback(callback); 2876 2868 2877 LogFlow(("Releasing machine, session...\n")); 2869 2878 gMachine = NULL; … … 2875 2884 //////////////////////////////////////////////////////////////////////////// 2876 2885 } 2877 while (0);2878 2886 2879 2887 /* Must be before com::Shutdown() */
Note:
See TracChangeset
for help on using the changeset viewer.

