- Timestamp:
- Sep 1, 2020 5:55:05 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp
r85985 r85986 282 282 * Detaches a payload from an event, internal version. 283 283 * 284 * @returns Pointer to the detached payload. Can be NULL if the payload has no payload. 284 285 * @param pEvent Event to detach payload for. 285 286 */ 286 static void shclEventPayloadDetachInternal(PSHCLEVENT pEvent) 287 { 288 /** @todo r=bird: This should return pPayload. It should also not need 289 * assert the validity of pEvent in non-strict builds, given that this 290 * is an static + internal function, that's a complete waste of time. */ 291 AssertPtrReturnVoid(pEvent); 287 static PSHCLEVENTPAYLOAD shclEventPayloadDetachInternal(PSHCLEVENT pEvent) 288 { 289 #ifdef VBOX_STRICT 290 AssertPtrReturn(pEvent, NULL); 291 #endif 292 293 PSHCLEVENTPAYLOAD pPayload = pEvent->pPayload; 292 294 293 295 pEvent->pPayload = NULL; 296 297 return pPayload; 294 298 } 295 299 … … 358 362 if (ppPayload) 359 363 { 360 *ppPayload = pEvent->pPayload;361 362 364 /* Make sure to detach payload here, as the caller now owns the data. */ 363 shclEventPayloadDetachInternal(pEvent);365 *ppPayload = shclEventPayloadDetachInternal(pEvent); 364 366 } 365 367 } … … 447 449 LogFlowFuncLeaveRC(rc); 448 450 return rc; 449 }450 451 /**452 * Detaches a payload from an event.453 *454 * @returns VBox status code.455 * @param pSource Event source of event to detach payload for.456 * @param uID Event ID to detach payload for.457 */458 void ShClEventPayloadDetach(PSHCLEVENTSOURCE pSource, SHCLEVENTID uID)459 {460 /** @todo r=bird: This API is not needed, it either is a no-op as it461 * replicates work done by ShClEventWait or it leaks the payload as462 * ShClEventWait is the only way to get it as far as I can tell. */463 464 AssertPtrReturnVoid(pSource);465 466 LogFlowFunc(("uSource=%RU16, uEvent=%RU32\n", pSource->uID, uID));467 468 PSHCLEVENT pEvent = shclEventGet(pSource, uID);469 if (pEvent)470 {471 shclEventPayloadDetachInternal(pEvent);472 }473 #ifdef DEBUG_andy474 else475 AssertMsgFailed(("uSource=%RU16, uEvent=%RU32\n", pSource->uID, uID));476 #endif477 451 } 478 452
Note:
See TracChangeset
for help on using the changeset viewer.