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. -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/28862 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I5eb8ef6f62b1dc949dc60eaa558f123b3b93819c Gerrit-Change-Number: 28862 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann@sysmocom.de> Gerrit-Reviewer: osmith <osmith@sysmocom.de> Gerrit-CC: laforge <laforge@osmocom.org> Gerrit-CC: pespin <pespin@sysmocom.de> Gerrit-Attention: osmith <osmith@sysmocom.de> Gerrit-Attention: laforge <laforge@osmocom.org> Gerrit-Attention: pespin <pespin@sysmocom.de> Gerrit-Attention: daniel <dwillmann@sysmocom.de> Gerrit-Comment-Date: Fri, 02 Sep 2022 17:33:45 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: osmith <osmith@sysmocom.de> Comment-In-Reply-To: laforge <laforge@osmocom.org> Comment-In-Reply-To: fixeria <vyanitskiy@sysmocom.de> Comment-In-Reply-To: pespin <pespin@sysmocom.de> Gerrit-MessageType: comment