Attention is currently required from: osmith, laforge, pespin, daniel. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/28862 )
Change subject: trxcon: rework trxcon_inst cleanup logic, add trxcon_fsm_pre_term_cb() ......................................................................
Patch Set 3:
(1 comment)
File src/host/trxcon/src/trxcon.c:
https://gerrit.osmocom.org/c/osmocom-bb/+/28862/comment/42aa1929_fcfe729a PS1, Line 270: /* Reparent trxcon_inst from ctx to trxcon->fi */
I think it's much more clearer doing this instead of mangling with talloc contexts: [..]
I don't think it's much more cleaner, and I don't like this approach. On the other hand, I don't want this patch to remain stuck in Gerrit any longer, so I will rework the patch as you suggested.
BTW FYI, I've seen usually this solved/workarounded by using talloc_steal during the cleanup callback when freeing the fi->priv.
I don't see why it's better: in my current patch we re-parent trxcon_inst during the FSM allocation; Pau proposes to re-parent the FSM instance before deallocation of trxcon_inst. In both cases we're mangling with talloc contexts. The only project I found implementing this is osmo-cbc.git, so I would not say it's a usual approach.