diff options
Diffstat (limited to 'src/VBox/HostServices/SharedOpenGL/crserverlib/server_stream.c')
| -rw-r--r-- | src/VBox/HostServices/SharedOpenGL/crserverlib/server_stream.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_stream.c b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_stream.c index b5c8a5bf..29670790 100644 --- a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_stream.c +++ b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_stream.c @@ -84,7 +84,7 @@ void crServerAddToRunQueue( CRClient *client ) /* give this client a unique number if needed */ if (!client->number) { - client->number = crServerGenerateID(&cr_server.idsPool.freeClientID); + client->number = client->conn->u32ClientID; } crDebug("Adding client %p to the run queue", client); @@ -281,6 +281,28 @@ crServerDeleteClient( CRClient *client ) pNode->next = cr_server.pCleanupClient; cr_server.pCleanupClient = pNode; } + + if (!cr_server.numClients) + { + /* if no clients, the guest driver may be unloaded, + * and thus the visible regions situation might not be under control anymore, + * so cleanup the 3D framebuffer data here + * @todo: what really should happen is that guest driver on unload + * posts some request to host that would copy the current framebuffer 3D data to the 2D buffer + * (i.e. to the memory used by the standard IFramebuffer API) */ + HCR_FRAMEBUFFER hFb; + for (hFb = CrPMgrFbGetFirstEnabled(); hFb; hFb = CrPMgrFbGetNextEnabled(hFb)) + { + int rc = CrFbUpdateBegin(hFb); + if (RT_SUCCESS(rc)) + { + CrFbRegionsClear(hFb); + CrFbUpdateEnd(hFb); + } + else + WARN(("CrFbUpdateBegin failed %d", rc)); + } + } } /** @@ -441,7 +463,7 @@ crServerDispatchMessage(CRConnection *conn, CRMessage *msg) { uint32_t cbWriteback = pCmdData->cbWriteback; rc = crVBoxServerInternalClientRead(conn->pClient, (uint8_t*)pCmdData->pWriteback, &cbWriteback); - CRASSERT(rc == VINF_SUCCESS || rc == VERR_BUFFER_OVERFLOW); + Assert(rc == VINF_SUCCESS || rc == VERR_BUFFER_OVERFLOW); *pCmdData->pcbWriteback = cbWriteback; } VBOXCRHGSMI_CMD_CHECK_COMPLETE(pCmdData, rc); |
