Fix process cleanup callback condition
... to address https://android-review.googlesource.com/c/device/generic/vulkan-cereal/+/2234610/comment/47a008c6_c358cb06/.
Bug: b/233939967
Test: cvd start --gpu_mode=gfxstream_guest_angle
and manual inspect some additional logging to check that the
callback from VkDecoderGlobalState has run.
Change-Id: I2a6ac7638a8991dee0b5c4f3c58015feeeb44245
diff --git a/stream-servers/FrameBuffer.cpp b/stream-servers/FrameBuffer.cpp
index d7f10df..75b2298 100644
--- a/stream-servers/FrameBuffer.cpp
+++ b/stream-servers/FrameBuffer.cpp
@@ -1635,11 +1635,8 @@
AutoLock mutex(m_lock);
- if (!hasEmulationGl() || !getDisplay()) {
- return;
- }
- auto colorBuffersToCleanup = cleanupProcGLObjects_locked(puid);
+ cleanupProcGLObjects_locked(puid);
// Run other cleanup callbacks
// Avoid deadlock by first storing a separate list of callbacks
@@ -1670,7 +1667,7 @@
bind = std::make_unique<RecursiveScopedContextBind>(getPbufferSurfaceContextHelper());
}
// Clean up window surfaces
- {
+ if (m_emulationGl) {
auto procIte = m_procOwnedEmulatedEglWindowSurfaces.find(puid);
if (procIte != m_procOwnedEmulatedEglWindowSurfaces.end()) {
for (auto whndl : procIte->second) {
@@ -1714,7 +1711,7 @@
}
// Clean up EGLImage handles
- {
+ if (m_emulationGl) {
auto procImagesIt = m_procOwnedEmulatedEglImages.find(puid);
if (procImagesIt != m_procOwnedEmulatedEglImages.end()) {
for (auto image : procImagesIt->second) {
@@ -1726,7 +1723,7 @@
}
// Unbind before cleaning up contexts
// Cleanup render contexts
- {
+ if (m_emulationGl) {
auto procIte = m_procOwnedEmulatedEglContexts.find(puid);
if (procIte != m_procOwnedEmulatedEglContexts.end()) {
for (auto ctx : procIte->second) {