Notify stub termination for local execution mode
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 25 Apr 2024 05:36:55 +0000 (14:36 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 18 Jun 2024 06:26:08 +0000 (15:26 +0900)
While calling a destructor of the stub, the proxy should get the
disconnected event from the stub.

Change-Id: I2ae41f3f69ede236059183ca0ce217beb2ff7a28
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
idlc/gen/version2/cpp_stub_body_generator_cb.hh

index 5cf1a7d..ed24abe 100644 (file)
@@ -293,10 +293,13 @@ void* <CLS_NAME>::ServiceBase::GetContext() const {
 
 <CLS_NAME>::~<CLS_NAME>() {
   _W("<CLS_NAME> dtor");
-  <CLS_NAME>_context_.reset();
-  for (auto& service : services_)
+  for (auto& service : services_) {
     service->OnTerminate();
+    if (<CLS_NAME>_context_)
+      <CLS_NAME>_context_->Disconnect(service->GetContext());
+  }
 
+  <CLS_NAME>_context_.reset();
   if (stub_ != nullptr)
     rpc_port_stub_destroy(stub_);
 }