Attention is currently required from: pespin. 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 1:
(1 comment)
File src/host/trxcon/src/trxcon.c:
https://gerrit.osmocom.org/c/osmocom-bb/+/28862/comment/f205ae69_821d626f PS1, Line 270: /* Reparent trxcon_inst from ctx to trxcon->fi */
Here again, reparenting makes everything more convoluted and difficult to follow imho, and must be u […]
We're dealing with a chicken-egg problem here. trxcon_inst is allocated first because a) it holds a pointer to an FSM instance, so we can do trxcon->fi = osmo_fsm_inst_alloc(...) directly; b) we pass a pointer to trxcon_inst when calling osmo_fsm_inst_alloc(), so it becomes fi->priv. To me using talloc_reparent() does not really look that critical.