GNOME Bugzilla – Bug 360219
Warning when running gedit in a terminal
Last modified: 2006-10-07 12:54:03 UTC
I'm using Ubuntu Edgy as my Linux distribution. WHen I open gedit from a terminal, after closing it these warnings appear: sys:1: Warning: invalid uninstantiatable type `(null)' in cast to `GeditPanel' ** (gedit:5543): CRITICAL **: _gedit_panel_get_active_item_id: assertion `GEDIT_IS_PANEL (panel)' failed ** (gedit:5543): CRITICAL **: _gedit_panel_get_active_item_id: assertion `GEDIT_IS_PANEL (panel)' failed Nothing strange happens when running gedit, just after closing it.
D'oh. My fault. This happens if you don't have any plugin adding a bottom pane, so that window->priv->bottom_pane is NULL.
On closer inspection the bug is trickier than that: the problem is that we the save-state (save active panel page, save panel size, etc) on window::destroy(), however destroy may run more than once, so the second time it tryes to get the active page of panels which have already been destroyed. This also explain why I didn't see the problem, using other plugins even not related to panels affect the refcount of window and thus the destruction of its children. This may also explain why from time to time the size of the bottom pane is wrong on startup. I'll try to fix it tomorrow.
Ubuntu bug about that: https://launchpad.net/distros/ubuntu/+source/gedit/+bug/63534
Created attachment 74195 [details] [review] patch patch fixing the issue. I was looking for a cleaner alternative than using a flag, but I couldn't find a suitable signal emitted just once when the window is closed. "delete-event" comes near but as far as I can see it's not emitted when the window is destroyed programmatically. A flag is not so bad afterall
committed.
thank you for quick fix, I've uploaded a package with the patch to Ubuntu edgy