[PATCH] Bug in genmarshal regarding return type OBJECT



(Repost in unidiff format, since I was notified that context
diffs tend to get ignored here...)

The marshaller code generated by glib-genmarshal
for return type OBJECT did not check for NULL return
values, which lead to warnings when calling the
type's release function (g_object_unref).

Johannes
Index: glib-genmarshal.c
===================================================================
RCS file: /cvs/gnome/glib/gobject/glib-genmarshal.c,v
retrieving revision 1.7
diff -u -r1.7 glib-genmarshal.c
--- glib-genmarshal.c	2001/03/09 14:02:30	1.7
+++ glib-genmarshal.c	2001/03/14 14:11:49
@@ -398,7 +398,10 @@
 	  fprintf (fout, "\n");
 	  fprintf (fout, "  %s (return_value, v_return);\n", sig->rarg->setter);
 	  if (sig->rarg->release)
-	    fprintf (fout, "  %s (v_return);\n", sig->rarg->release);
+	    {
+	      fprintf (fout, "  if (v_return)\n");
+	      fprintf (fout, "    %s (v_return);\n", sig->rarg->release);
+	    }
 	}
 
       /* cfile marshal footer */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]