Change in osmocom-bb[master]: trxcon: rework trxcon_inst cleanup logic, add trxcon_fsm_pre_term_cb()
Attention is currently required from: fixeria. pespin 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/99bb3f4c_749a77b7 PS1, Line 270: /* Reparent trxcon_inst from ctx to trxcon->fi */
We're dealing with a chicken-egg problem here. […] I think it's much more clearer doing this instead of mangling with talloc contexts: fi = osmo_fsm_inst_alloc( priv = NULL) fi->priv = trxcon = talloc_zero(fi, struct trxcon_inst); trxcon->fi = fi;
BTW FYI, I've seen usually this solved/workarounded by using talloc_steal during the cleanup callback when freeing the fi->priv. Let's see what other think about this topic. I'd really avoid reparenting and this kind of stuff as much as possible, otherwise there's a high potential of shooting at your/someone else's foot later on when updating the code. -- 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: 1 Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin@sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy@sysmocom.de> Gerrit-Comment-Date: Mon, 01 Aug 2022 12:52:45 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy@sysmocom.de> Comment-In-Reply-To: pespin <pespin@sysmocom.de> Gerrit-MessageType: comment
participants (1)
-
pespin