Re: [Bug+Fix] g_assert_not_reached() triggerd after running init wizard

Peter Bloomfield <[email protected]> Thu, 18 Apr 2019 15:24:57 -0400
Newsgroups gmane.comp.gnome.apps.balsa
Message-ID <[email protected]>
Hi Albrecht,

On 04/17/2019 01:31:12 PM Wed, Albrecht Dreß wrote:
> Hi all,
> 
> when running Balsa for the first time, after successfully running the wizard, Balsa ejects with
> 
> ERROR:geometry-manager.c:63:geometry_manager_init: code should not be reached
> 
> Reason: When I wrote the geometry manager, I did not realise that config_global_load() may actually be called multiple times (from config_init()) when Balsa has not yet been configured.  Thus, the g_assert_not_reached() (which I inserted to detect multiple definitions of the same key) is plain wrong.
> 
> The attached patch fixes the issue.  Note that I use a single-entry-single-exit solution here which is usually be considered as safer as the function uses a lock which may easily be forgotten to unlock…  If you feel this is over-engineered, the g_assert_not_reached() could also just be replaced by “G_UNLOCK(geometry_hash);return;”.

Thanks for the patch! Pushed to GitLab.

Peter

_______________________________________________
balsa-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/balsa-list
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQS030wPRfNNA5alz3MfX9S1uSp09QUCXLjPCQAKCRAfX9S1uSp0
9WY/AJ9eqcfPHYC6WYv00Ui/wXqfs6H05gCeIWZFLK7EFixsFKb68QTrt0Kjsc4=
=Hs6q
-----END PGP SIGNATURE-----