bug in glib/gobject/glib-genmarshal.c



The marshaller code generated by glib-genmarshal
for return type OBJECT does not check for NULL return
values, which leads to warnings when unref'ing.

The attached patch seems to cure this problem.

Johannes
Index: glib-genmarshal.c
===================================================================
RCS file: /cvs/gnome/glib/gobject/glib-genmarshal.c,v
retrieving revision 1.7
diff -c -r1.7 glib-genmarshal.c
*** glib-genmarshal.c	2001/03/09 14:02:30	1.7
--- glib-genmarshal.c	2001/03/12 17:18:55
***************
*** 398,404 ****
  	  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);
  	}
  
        /* cfile marshal footer */
--- 398,407 ----
  	  fprintf (fout, "\n");
  	  fprintf (fout, "  %s (return_value, v_return);\n", sig->rarg->setter);
  	  if (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]