Changeset 18708 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Apr 3, 2009 5:55:59 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedClipboard/x11-clipboard.cpp
r18633 r18708 164 164 RTSemEventCreate(&g_ctxHost.waitForData); 165 165 RTSemMutexCreate(&g_ctxHost.clipboardMutex); 166 rc = VBoxX11ClipboardInitX11(&g_ctxHost, &pBackend);167 if ( RT_FAILURE(rc))166 pBackend = VBoxX11ClipboardConstructX11(&g_ctxHost); 167 if (pBackend == NULL) 168 168 { 169 169 RTSemEventDestroy(g_ctxHost.waitForData); 170 170 RTSemMutexDestroy(g_ctxHost.clipboardMutex); 171 LogRel(("Failed to start the host shared clipboard service.\n")); 171 LogRel(("Failed to start the host shared clipboard service, out of memory.\n")); 172 rc = VERR_NO_MEMORY; 172 173 } 173 174 else … … 198 199 * even if we are not waiting. */ 199 200 RTSemEventSignal(g_ctxHost.waitForData); 200 rc = VBoxX11ClipboardTermX11(g_ctxHost.pBackend); 201 if (RT_SUCCESS(rc)) 202 { 203 /* We can safely destroy these as the backend has exited 204 * successfully and no other calls from the host code should be 205 * forthcoming. */ 206 /** @todo can the backend fail to exit successfully? What then? */ 207 RTSemEventDestroy(g_ctxHost.waitForData); 208 RTSemMutexDestroy(g_ctxHost.clipboardMutex); 209 } 201 VBoxX11ClipboardDestructX11(g_ctxHost.pBackend); 202 /* We can safely destroy these as the backend has exited 203 * successfully and no other calls from the host code should be 204 * forthcoming. */ 205 RTSemEventDestroy(g_ctxHost.waitForData); 206 RTSemMutexDestroy(g_ctxHost.clipboardMutex); 210 207 } 211 208 … … 227 224 * client at a time. */ 228 225 rc = VBoxX11ClipboardStartX11(g_ctxHost.pBackend, 229 X11 /* initial owner*/);226 true /* fOwnClipboard */); 230 227 return rc; 231 228 } … … 263 260 RTSemMutexRequest(g_ctxHost.clipboardMutex, RT_INDEFINITE_WAIT); 264 261 g_ctxHost.pClient = NULL; 265 VBoxX11ClipboardStopX11(g_ctxHost.pBackend); 262 /** @todo handle this slightly more reasonably, or be really sure 263 * it won't go wrong. */ 264 AssertRC(VBoxX11ClipboardStopX11(g_ctxHost.pBackend)); 266 265 RTSemMutexRelease(g_ctxHost.clipboardMutex); 267 266 }
Note:
See TracChangeset
for help on using the changeset viewer.