From 3169d243ad7783b80d66d4613f9280d08214dc87 Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Wed, 31 Aug 2022 17:14:34 +0900 Subject: [PATCH] Fix CallbackBase for stub Change-Id: Ic0b64cdf31f7855b1ccf0bcca162228c821873ce Signed-off-by: Sangyoon Jang --- idlc/gen_cion/cs_cion_gen_base.cc | 2 +- idlc/gen_cion/cs_cion_gen_base_cb.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/idlc/gen_cion/cs_cion_gen_base.cc b/idlc/gen_cion/cs_cion_gen_base.cc index 419f456..e6a8c21 100644 --- a/idlc/gen_cion/cs_cion_gen_base.cc +++ b/idlc/gen_cion/cs_cion_gen_base.cc @@ -365,7 +365,7 @@ std::string CsCionGeneratorBase::ConvertTypeToDeserializer( if (IsDelegateType(type)) { ret += id + " = new " + n - + "(peerInfo, new WeakReference(b));\n"; + + "(peerInfo, new WeakReference(b), new WeakReference(this));\n"; ret += "CallbackBase."; } else { ret += id + " = new " + n +"();\n"; diff --git a/idlc/gen_cion/cs_cion_gen_base_cb.h b/idlc/gen_cion/cs_cion_gen_base_cb.h index 994f884..7bcd81e 100644 --- a/idlc/gen_cion/cs_cion_gen_base_cb.h +++ b/idlc/gen_cion/cs_cion_gen_base_cb.h @@ -67,11 +67,11 @@ R"__cs_cb( public $$(bool once = false) : base((int)DelegateId.$$ )__cs_cb"; const char CB_CALLBACK_CTOR_STUB[] = -R"__cs_cb( internal $$(PeerInfo peerInfo, WeakReference service) : base((int)DelegateId.$$, false) +R"__cs_cb( internal $$(PeerInfo peerInfo, WeakReference service, WeakReference serverBase) : base((int)DelegateId.$$, false) { _peerInfo = peerInfo; _service = service; - _serverBase = ($$)service.Target; + _serverBase = ($$)serverBase.Target; } )__cs_cb"; -- 2.7.4