VirtualBox

Changeset 82893 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 28, 2020 4:53:51 PM (5 years ago)
Author:
vboxsync
Message:

Shared Clipboard: Dealt with event retention for ShClSvcDataReadRequest(). bugref:9437

Location:
trunk/src/VBox/HostServices/SharedClipboard
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp

    r82881 r82893  
    188188            *ppvData = pPayload ? pPayload->pvData : NULL;
    189189            *pcbData = pPayload ? pPayload->cbData : 0;
    190 
    191             /* Detach the payload, as the caller then will own the data. */
    192             ShClEventPayloadDetach(&pCtx->pClient->EventSrc, idEvent);
    193             /**
    194              * @todo r=bird: The payload has already been detached,
    195              * ShClEventPayloadDetach and ShClEventWait does the exact same
    196              * thing, except for the extra waiting in the latter.
    197              */
    198         }
    199 
     190        }
     191
     192        ShClEventRelease(&pCtx->pClient->EventSrc, idEvent);
    200193        ShClEventUnregister(&pCtx->pClient->EventSrc, idEvent);
    201194    }
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp

    r82880 r82893  
    354354                *ppv = pPayload ? pPayload->pvData : NULL;
    355355                *pcb = pPayload ? pPayload->cbData : 0;
    356 
    357                 /* Detach the payload, as the caller then will own the data. */
    358                 ShClEventPayloadDetach(&pCtx->pClient->EventSrc, idEvent);
    359356            }
    360357
     358            ShClEventRelease(&pCtx->pClient->EventSrc, idEvent);
    361359            ShClEventUnregister(&pCtx->pClient->EventSrc, idEvent);
    362360        }
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp

    r82889 r82893  
    12041204    int rc = VERR_NOT_SUPPORTED;
    12051205
     1206    SHCLEVENTID idEvent = NIL_SHCLEVENTID;
     1207
    12061208    while (fFormats)
    12071209    {
     
    12381240            RTCritSectEnter(&pClient->CritSect);
    12391241
    1240             const SHCLEVENTID idEvent = ShClEventIdGenerateAndRegister(&pClient->EventSrc);
     1242            idEvent = ShClEventIdGenerateAndRegister(&pClient->EventSrc);
    12411243            if (idEvent != NIL_SHCLEVENTID)
    12421244            {
     
    12731275        RTCritSectEnter(&pClient->CritSect);
    12741276
     1277        /* Retain the last event generated (in case there were multiple clipboard formats)
     1278         * if we need to return the event ID to the caller. */
     1279        if (pidEvent)
     1280        {
     1281            ShClEventRetain(&pClient->EventSrc, idEvent);
     1282            *pidEvent = idEvent;
     1283        }
     1284
    12751285        shClSvcClientWakeup(pClient);
    12761286
    12771287        RTCritSectLeave(&pClient->CritSect);
    12781288    }
    1279 
    1280     /** @todo BUGBUG What to do with allocated events? Which one to return? */
    12811289
    12821290    LogFlowFuncLeaveRC(rc);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette