antkiller996 commented on issue #2424:
URL: https://github.com/apache/brpc/issues/2424#issuecomment-1783660291

   > > 我们可以在AuthContext新增属性:on_destroy_context(AuthContext* ctx), 
用户通过out_ctx->set_destroy_context注册回调。
   > > 在Socket::OnRecycle中delete _auth_context 之前,调用其on_destroy_context回调函数。
   > 
   > 看起来可行。可以直接在AuthContext的析构函数里调用 on_destroy_context
   析构函数函数内不能安全地访问成员变量。针对最初的需求,我们是要在on_destroy_context中获取到存在AuthContext里的一些成员的。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to