Changeset 40020 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Feb 7, 2012 4:02:30 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 76142
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp
r39991 r40020 116 116 /* puContextID is optional. */ 117 117 118 int rc; 118 int rc = VERR_NOT_FOUND; 119 120 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 119 121 120 122 /* Create a new context ID and assign it. */ … … 139 141 if (RT_SUCCESS(rc)) 140 142 { 141 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);142 143 143 /* Add callback with new context ID to our callback map. */ 144 144 mCallbackMap[uNewContextID] = *pCallback; … … 154 154 155 155 /** 156 * Destroys the formerly allocated callback data. The callback then 157 * needs to get removed from the callback map via callbackRemove(). 156 158 * Does not do locking! 157 159 * … … 173 175 it->second.cbData = 0; 174 176 } 175 176 /* Remove callback context (not used anymore). */ 177 mCallbackMap.erase(it); 178 } 177 } 178 } 179 180 /** 181 * Removes a callback from the callback map. 182 * Does not do locking! 183 * 184 * @param uContextID 185 */ 186 void Guest::callbackRemove(uint32_t uContextID) 187 { 188 callbackDestroy(uContextID); 189 190 mCallbackMap.erase(uContextID); 179 191 } 180 192 … … 1708 1720 vrc = callbackInit(&callback, VBOXGUESTCTRLCALLBACKTYPE_EXEC_START, pProgress); 1709 1721 if (RT_SUCCESS(vrc)) 1710 {1711 /* Allocate and assign payload. */1712 callback.cbData = sizeof(CALLBACKDATAEXECSTATUS);1713 PCALLBACKDATAEXECSTATUS pData = (PCALLBACKDATAEXECSTATUS)RTMemAlloc(callback.cbData);1714 AssertReturn(pData, E_OUTOFMEMORY);1715 RT_BZERO(pData, callback.cbData);1716 callback.pvData = pData;1717 }1718 1719 if (RT_SUCCESS(vrc))1720 1722 vrc = callbackAdd(&callback, &uContextID); 1721 1723 … … 2012 2014 } 2013 2015 2014 /* The callback isn't needed anymore -- just was kept locally. */ 2015 callbackDestroy(uContextID); 2016 { 2017 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 2018 2019 /* The callback isn't needed anymore -- just was kept locally. */ 2020 callbackRemove(uContextID); 2021 } 2016 2022 2017 2023 /* Cleanup. */ … … 2207 2213 rc = handleErrorHGCM(vrc); 2208 2214 2209 /* The callback isn't needed anymore -- just was kept locally. */ 2210 callbackDestroy(uContextID); 2215 { 2216 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 2217 2218 /* The callback isn't needed anymore -- just was kept locally. */ 2219 callbackRemove(uContextID); 2220 } 2211 2221 2212 2222 /* Cleanup. */ -
trunk/src/VBox/Main/src-client/GuestImpl.cpp
r39898 r40020 118 118 LogFlowThisFunc(("\n")); 119 119 120 /* Enclose the state transition Ready->InUninit->NotReady */ 121 AutoUninitSpan autoUninitSpan(this); 122 if (autoUninitSpan.uninitDone()) 123 return; 124 120 125 #ifdef VBOX_WITH_GUEST_CONTROL 121 /* r=poetzsch: Not sure if this is really right. Please note that122 * IGuest::uninit is called twice (which I also consider a bug). So the123 * test for uninitDone should be always first! */124 126 /* Scope write lock as much as possible. */ 125 127 { … … 144 146 callbackDestroy(it->first); 145 147 146 /* Clear process map . */148 /* Clear process map (remove all callbacks). */ 147 149 mGuestProcessMap.clear(); 148 150 } 149 151 #endif 150 151 /* Enclose the state transition Ready->InUninit->NotReady */152 AutoUninitSpan autoUninitSpan(this);153 if (autoUninitSpan.uninitDone())154 return;155 152 156 153 #ifdef VBOX_WITH_DRAG_AND_DROP
Note:
See TracChangeset
for help on using the changeset viewer.