Add a flag for removed instance 84/232084/4
authorJunghoon Park <jh9216.park@samsung.com>
Tue, 28 Apr 2020 06:41:04 +0000 (15:41 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Tue, 28 Apr 2020 09:35:18 +0000 (18:35 +0900)
Change-Id: Ic0aeac0f8ff18b2af8bfcbc92f2a3b7fe8343ddb
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
screen_connector_remote_surface/remote_surface.cc
screen_connector_remote_surface/remote_surface_implementation.h

index 113b57f0e2ab839d31a1dec11be03fd3a78c459b..0fc70ea737af9f148e6b1ed3a32edcf641e91185 100644 (file)
@@ -92,6 +92,9 @@ void RemoteSurface::Impl::OnAppAdded(const std::string &appId,
                                      const std::string& instId,
                                      const int pid,
                                      const unsigned int surfaceId) {
+  if (disposed_)
+    return;
+
   if (inst_id_ != instId)
     return;
 
@@ -107,17 +110,24 @@ void RemoteSurface::Impl::OnAppRemoved(const std::string& appId,
                                        const std::string& instId,
                                        const int pid,
                                        const unsigned int surfaceId) {
+  if (disposed_)
+    return;
+
   if (inst_id_ != instId)
     return;
 
   LOGW("removed %s", instId.c_str());
   parent_->OnBufferRemoved(appId, instId, pid);
+  disposed_ = true;
 }
 
 void RemoteSurface::Impl::OnAppUpdated(const std::string &appId,
                                        const std::string& instId,
                                        const int pid,
                                        const unsigned int surfaceId) {
+  if (disposed_)
+    return;
+
   if (inst_id_ != instId)
     return;
 
index af56724796400e3b8c6fd484bcf7de423de8b1a5..dcc870f80c7af5bf032859c011ba4eb96c3c889f 100644 (file)
@@ -84,6 +84,7 @@ class RemoteSurface::Impl : AulHandle::IEventListener, ITRS::IEventListener {
   RemoteSurface* parent_;
   bool mock_;
   std::unique_ptr<bool> queuing_visibility_;
+  bool disposed_ = false;
 };
 
 }  // namespace screen_connector