Changeset 22305 in vbox for trunk/src/VBox/Frontends/VBoxSDL
- Timestamp:
- Aug 17, 2009 5:37:41 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 51179
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r22173 r22305 854 854 uint32_t memorySize = 0; 855 855 uint32_t vramSize = 0; 856 VBoxSDLCallback *callback = NULL; 857 VBoxSDLConsoleCallback *consoleCallback = NULL; 856 VBoxSDLCallback *cbVBoxImpl = NULL; 857 /* wrapper around above object */ 858 ComPtr<IVirtualBoxCallback> callback; 859 VBoxSDLConsoleCallback *cbConsoleImpl = NULL; 860 ComPtr<IConsoleCallback> consoleCallback; 861 858 862 bool fFullscreen = false; 859 863 bool fResizable = true; … … 1850 1854 #endif 1851 1855 1856 1852 1857 for (ULONG i = 0; i < gcMonitors; i++) 1853 1858 { 1854 1859 // register our framebuffer 1855 1860 rc = gDisplay->SetFramebuffer(i, gpFramebuffer[i]); 1856 if ( rc != S_OK)1861 if (FAILED(rc)) 1857 1862 { 1858 1863 RTPrintf("Error: could not register framebuffer object!\n"); … … 1866 1871 1867 1872 // register a callback for global events 1868 callback = new VBoxSDLCallback(); 1869 callback->AddRef(); 1873 cbVBoxImpl = new VBoxSDLCallback(); 1874 rc = createCallbackWrapper((IVirtualBoxCallback*)cbVBoxImpl, callback.asOutParam()); 1875 if (FAILED(rc)) 1876 goto leave; 1870 1877 virtualBox->RegisterCallback(callback); 1871 1878 1872 1879 // register a callback for machine events 1873 consoleCallback = new VBoxSDLConsoleCallback(); 1874 consoleCallback->AddRef(); 1880 cbConsoleImpl = new VBoxSDLConsoleCallback(); 1881 rc = createCallbackWrapper((IConsoleCallback*)cbConsoleImpl, consoleCallback.asOutParam()); 1882 if (FAILED(rc)) 1883 goto leave; 1875 1884 gConsole->RegisterCallback(consoleCallback); 1876 1885 // until we've tried to to start the VM, ignore power off events 1877 c onsoleCallback->ignorePowerOffEvents(true);1886 cbConsoleImpl->ignorePowerOffEvents(true); 1878 1887 1879 1888 #ifdef VBOX_WITH_VRDP … … 2172 2181 // accept power off events from now on because we're running 2173 2182 // note that there's a possible race condition here... 2174 c onsoleCallback->ignorePowerOffEvents(false);2183 cbConsoleImpl->ignorePowerOffEvents(false); 2175 2184 2176 2185 rc = gConsole->COMGETTER(Keyboard)(gKeyboard.asOutParam()); … … 2685 2694 && machineState == MachineState_Running) 2686 2695 { 2687 c onsoleCallback->ignorePowerOffEvents(true);2696 cbConsoleImpl->ignorePowerOffEvents(true); 2688 2697 ComPtr <IProgress> progress; 2689 2698 CHECK_ERROR_BREAK(gConsole, PowerDown(progress.asOutParam())); … … 2792 2801 gMachine = NULL; 2793 2802 session = NULL; 2794 LogFlow(("Releasing callback handlers...\n"));2795 if (callback)2796 callback->Release();2797 if (consoleCallback)2798 consoleCallback->Release();2799 2800 2803 LogFlow(("Releasing VirtualBox object...\n")); 2801 2804 virtualBox = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.