diff options
Diffstat (limited to 'src/VBox/HostServices/SharedOpenGL/crserverlib/server_stream.c')
-rw-r--r-- | src/VBox/HostServices/SharedOpenGL/crserverlib/server_stream.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_stream.c b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_stream.c index bfadeda92..29670790a 100644 --- a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_stream.c +++ b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_stream.c @@ -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)); + } + } } /** |