After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 773979 - GdkGLContext does not chain finalize handler
GdkGLContext does not chain finalize handler
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-11-05 13:39 UTC by Massimo
Modified: 2016-11-10 19:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GdkGLContext chain finalize handler (699 bytes, patch)
2016-11-05 13:39 UTC, Massimo
committed Details | Review

Description Massimo 2016-11-05 13:39:52 UTC
Created attachment 339172 [details] [review]
GdkGLContext chain finalize handler

Running this program: 
 
#include <gtk/gtk.h>
 
int
main (int   argc,
      char *argv[])
{
  if (gtk_init_check (&argc, &argv))
    {
      GtkWidget *win  = gtk_window_new (GTK_WINDOW_TOPLEVEL);
      GtkWidget *area = gtk_gl_area_new ();

      gtk_gl_area_set_required_version (GTK_GL_AREA (area), 3, 2);
      gtk_container_add (GTK_CONTAINER (win), area);
      gtk_widget_show_all (win);

      gtk_widget_destroy (win);
    }

  return 0;
}



after setting GOBJECT_DEBUG=objects results in:

**
GLib-GObject:ERROR:gobject.c:3195:g_object_unref: assertion failed: (g_hash_table_lookup (debug_objects_ht, object) == NULL)

inspecting gobject.c, a comment says it is a trap for objects
not chaining finalize handlers and effectively chaining in 
GdkGLContext finalize handler fixes the issue.

https://git.gnome.org/browse/gtk+/tree/gdk/gdkglcontext.c?h=gtk-3-22&id=a1115c05be1a8bc6e3e299e72accbbee12bd77a7#n151

git describe says:

3.22.2-23-g04db216
Comment 1 Emmanuele Bassi (:ebassi) 2016-11-08 16:26:59 UTC
Review of attachment 339172 [details] [review]:

Nicely spotted.