Remove service surface in WMClient if service surface vanishes
[apps/agl-service-windowmanager-2017.git] / src / wm_client.cpp
index 356cd6f..f2ad7be 100644 (file)
@@ -141,6 +141,19 @@ bool WMClient::removeSurfaceIfExist(unsigned surface)
         this->surface = INVALID_SURFACE_ID;
         ret = true;
     }
+    else
+    {
+        for(auto &x : this->service2surfaces)
+        {
+            if(x.second = surface)
+            {
+                ret = true;
+                string key = x.first;
+                this->service2surfaces.erase(key);
+                this->service2supplier.erase(key);
+            }
+        }
+    }
     return ret;
 }