pidgin/pidgin

Fix some assertions from GTK

2021-01-23, Elliott Sales de Andrade
b317bb7479e5
Parents f752bc4c3e21
Children 447c01698e1c
Fix some assertions from GTK

* Fix assertion on startup due to dark mode window.
For whatever reason, this window must be destroyed, not unrefed.

* Fix some assertions on shutdown.
The GTK buddy list GObject is finalized before the Purple buddy list, so when Purple deletes nodes, the GTK list model is NULL, and prints out a bunch of assertions.

Testing Done:
Run with debug messages and see they're gone.

Reviewed at https://reviews.imfreedom.org/r/446/
--- a/pidgin/gtkblist.c Fri Jan 22 19:29:23 2021 -0600
+++ b/pidgin/gtkblist.c Sat Jan 23 20:26:48 2021 -0600
@@ -5538,6 +5538,9 @@
if (!gtknode->row)
return FALSE;
+ if (!GTK_IS_TREE_MODEL(gtkblist->treemodel)) {
+ return FALSE;
+ }
if ((path = gtk_tree_row_reference_get_path(gtknode->row)) == NULL)
return FALSE;
--- a/pidgin/pidginstylecontext.c Fri Jan 22 19:29:23 2021 -0600
+++ b/pidgin/pidginstylecontext.c Sat Jan 23 20:26:48 2021 -0600
@@ -52,7 +52,7 @@
gtk_style_context_get(context, GTK_STATE_FLAG_NORMAL,
GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &bg,
NULL);
- g_object_unref(G_OBJECT(window));
+ gtk_widget_destroy(window);
g_once_init_leave(&background, bg);
}