Skip to content

Fix the generic account setup widget

Nick Thomas requested to merge lupine/telepathy-account-widgets:patch-1 into master

g_clear_object (self->ui_details->gui) is unconditionally run in the do_constructed handler. For special-cased protocols, or for generic protocols that are ready when we call account_widget_build_generic, this is fine.

However, if the generic protocol is not ready when this function is called, account_widget_setup_generic is run asynchronously, causing assertion failures when it runs after do_constructed has completed:

gtk_builder_get_object:assertion 'GTK_IS_BUILDER (builder)' failed
gtk_builder_get_object: assertion 'GTK_IS_BUILDER (builder)' failed
gtk_grid_attach: assertion 'GTK_IS_GRID (grid)' failed
gtk_grid_attach: assertion 'GTK_IS_GRID (grid)' failed
gtk_grid_attach: assertion 'GTK_IS_GRID (grid)' failed
gtk_grid_attach: assertion 'GTK_IS_GRID (grid)' failed
g_object_unref: assertion 'G_IS_OBJECT (object)' failed

The visible effect is that the settings for the generic protocol are never shown to the user. You can still try to add the account, but if any of the settings are required, it will fail. I encountered this while developing a telepathy connection manager for Delta Chat.

Delaying the call to g_clear_object until disposal seems safe enough, and fixes the issue for me.

Edited by Nick Thomas

Merge request reports