Fix current buffer assign position 36/243636/1
authorhyunho <hhstark.kang@samsung.com>
Wed, 9 Sep 2020 01:00:48 +0000 (10:00 +0900)
committerhyunho <hhstark.kang@samsung.com>
Wed, 9 Sep 2020 01:00:48 +0000 (10:00 +0900)
- current buffer should be assigned before OnChanged

Change-Id: I5e755d7d0da3a25b9a3f7c9aa46fa4433f68e9d3
Signed-off-by: hyunho <hhstark.kang@samsung.com>
watch-holder-base/src/watch_base.cc

index 4eae633..1c7d5a4 100644 (file)
@@ -169,11 +169,12 @@ void WatchBase::OnBufferChanged(int type,
 
   if (impl_->current_buffer_ == nullptr) {
     LOGD("first added !!!! %d %s", type, GetAppId().c_str());
+    impl_->current_buffer_ = tbm;
     OnAdded(GetAppId(), GetInstId(), GetPid(), tbm);
   } else {
+    impl_->current_buffer_ = tbm;
     OnChanged(GetAppId(), GetInstId(), GetPid(), tbm);
   }
-  impl_->current_buffer_ = tbm;
 }
 
 void WatchBase::OnAdded(const std::string& appId, const std::string& instId,