`geany 1.37 (git >= ea649d80) (built on 2020-05-21 with GTK 3.22.30, GLib 2.56.4)`
On exit from Geany, the document list component of the addons plugin causes an error message: `Gtk-CRITICAL gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed`
I have narrowed it down to the `ao_doc_list_finalize` function, and found that the `priv->overflow_menu_item`, though non-null, is invalid, i.e. `GTK_IS_WIDGET` returns false, exactly as the error message claims.
Not sufficiently familiar with the code to guess where the corruption is occurring, and hoping the maintainer may be able to shed some light.
Not a major problem, as the app is exiting anyway, just annoying.
Thanks for the detailed report. I cannot reproduce it with: `geany 1.37 (git >= ea649d80) (built on May 22 2020 with GTK 3.24.20, GLib 2.64.2)`.
Are there maybe additional steps required to trigger this, like opening something, using some menu item or anything like this?
Could you test if the following path would fix the error message? ```diff diff --git a/addons/src/ao_doclist.c b/addons/src/ao_doclist.c index a96a2f6e..f3bc1b81 100644 --- a/addons/src/ao_doclist.c +++ b/addons/src/ao_doclist.c @@ -112,10 +112,14 @@ static void ao_doc_list_finalize(GObject *object) { AoDocListPrivate *priv = AO_DOC_LIST_GET_PRIVATE(object);
- if (priv->toolbar_doclist_button != NULL) + if (priv->toolbar_doclist_button != NULL) { gtk_widget_destroy(GTK_WIDGET(priv->toolbar_doclist_button)); - if (priv->overflow_menu_item != NULL) + priv->toolbar_doclist_button = NULL; + } + if (priv->overflow_menu_item != NULL) { gtk_widget_destroy(priv->overflow_menu_item); + priv->overflow_menu_item = NULL; + }
G_OBJECT_CLASS(ao_doc_list_parent_class)->finalize(object); } ```
It's just a wild guess that maybe the finalize() function is called twice.
Tried your fix, no luck. :-(
Verified, by adding `printf()`, that the `finalize()` function is only called once.
It is very sensitive to exact local conditions, and after resizing the window a few times to make the overflow menu come and go, I can now longer make the bug happen at all, so not surprised you couldn't reproduce it.
Sometimes, on start-up, I get a whole bunch of GTK errors, like this: ```(geany:30311): Gtk-WARNING **: 13:16:14.355: Negative content width -17 (allocation 1, extents 9x9) while allocating gadget (node entry, owner GtkEntry) (geany:30311): Gtk-WARNING **: 13:16:14.355: Negative content height -1 (allocation 1, extents 1x1) while allocating gadget (node entry, owner GtkEntry) (geany:30311): Gtk-WARNING **: 13:16:14.355: Negative content width -1 (allocation 1, extents 1x1) while allocating gadget (node scrolledwindow, owner GtkScrolledWindow) (geany:30311): Gtk-WARNING **: 13:16:14.355: Negative content height -1 (allocation 1, extents 1x1) while allocating gadget (node scrolledwindow, owner GtkScrolledWindow) (geany:30311): Gtk-CRITICAL **: 13:16:14.355: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar (geany:30311): Gtk-CRITICAL **: 13:16:14.355: gtk_widget_get_preferred_width_for_height: assertion 'height >= 0' failed (geany:30311): Gtk-WARNING **: 13:16:14.355: gtk_widget_size_allocate(): attempt to allocate widget with width 13 and height -25 (geany:30311): Gtk-CRITICAL **: 13:16:14.355: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar ``` which may or may not be from `doclist`, or from another part of `addons`.
I'll see what I can find out if it starts to happen again, other wise not a lot we can do, except hope that it's not some random corruption happening elsewhere and waiting to trip us up...
Those look like being from the plugin manager dialog, no idea why it does that.
Closed #983.
I just tried it again and still cannot reproduce. `priv->overflow_menu_item` is either `NULL` or a valid widget instance.
If anyone has more information or a reliable way to reproduce, please re-open.
github-comments@lists.geany.org