Bug 818629: Don't use "g_free" as finalize function in xt_event_funcs - just let refcounting take care of cleaning up. r=karlt
authorDaniel Holbert <dholbert@cs.stanford.edu>
Wed, 05 Dec 2012 21:05:46 -0800
changeset 115184 a16704573ef7215df3b21a865e1e1c4787d1e782
parent 115183 326520e2222201cb01deed2b4b66adefb1f8b68a
child 115185 d5a465367a8e7fa3e91c5f22808153c3cb8a68c0
push id23991
push useremorley@mozilla.com
push dateFri, 07 Dec 2012 14:14:29 +0000
treeherdermozilla-central@8432562db685 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs818629
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 818629: Don't use "g_free" as finalize function in xt_event_funcs - just let refcounting take care of cleaning up. r=karlt
widget/gtkxtbin/gtk2xtbin.c
--- a/widget/gtkxtbin/gtk2xtbin.c
+++ b/widget/gtkxtbin/gtk2xtbin.c
@@ -132,17 +132,17 @@ xt_event_dispatch (GSource*  source_data
 
   return TRUE;  
 }
 
 static GSourceFuncs xt_event_funcs = {
   xt_event_prepare,
   xt_event_check,
   xt_event_dispatch,
-  g_free,
+  NULL,
   (GSourceFunc)NULL,
   (GSourceDummyMarshal)NULL
 };
 
 static gboolean
 xt_event_polling_timer_callback(gpointer user_data)
 {
   Display * display;
@@ -479,16 +479,17 @@ xt_client_xloop_create(void)
     gs = g_source_new(&xt_event_funcs, sizeof(GSource));
     if (!gs) {
       return;
     }
 
     g_source_set_priority(gs, GDK_PRIORITY_EVENTS);
     g_source_set_can_recurse(gs, TRUE);
     tag = g_source_attach(gs, (GMainContext*)NULL);
+    g_source_unref(gs);
 #ifdef VMS
     cnumber = XConnectionNumber(xtdisplay);
 #else
     cnumber = ConnectionNumber(xtdisplay);
 #endif
     xt_event_poll_fd.fd = cnumber;
     xt_event_poll_fd.events = G_IO_IN; 
     xt_event_poll_fd.revents = 0;    /* hmm... is this correct? */