Remove service surface in WMClient if service surface vanishes
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Tue, 25 Sep 2018 04:30:07 +0000 (13:30 +0900)
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Tue, 25 Sep 2018 04:30:12 +0000 (13:30 +0900)
Change-Id: I3c12a8313c6aaa411001fec260d09106f897664e
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
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;
 }