From 29674827628e4e4cfb4426cd110b1e348465ddfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= Date: Sun, 3 Nov 2013 14:01:43 +0100 Subject: [PATCH] Revert "gtk: Mark the Cairo.Context in Widget.Drawn as owned" This reverts commit 21bfaa7a9d84218e01529a7b9af28085f6e68306. After fixing the memory leak when finalizing a Context object in the previous commit, native crashes would happen when using a Gtk#-based app. The reason is that this commit tried to fix the leak with the wrong approach of marking the CairoContext as owned. This avoided the leak by not incrementing the reference count, but now that the leak is fixed, cairo_destroy is called one time too much. The CairoContext passed in the Draw signal is not marked as transfer-ownership=full in GObject-Introspection metadata. So unmarking this as owned fixes the "potential double-free" assertion that was causing the crash. --- gtk/Gtk.metadata | 1 - 1 file changed, 1 deletion(-) diff --git a/gtk/Gtk.metadata b/gtk/Gtk.metadata index 6d4a31086..62d45d90e 100644 --- a/gtk/Gtk.metadata +++ b/gtk/Gtk.metadata @@ -863,7 +863,6 @@ 1 Drawn true - true WidgetEvent event WidgetEventAfter