Hi.<br><br>In your usage below, you want to call g_object_unref on the notification after you've shown it. You won't need it around unless you're dealing with updating it or handling multiple actions, in which case you'd then want to unref when you're finished with it then. I recommend looking at libnotify/tests/ for some examples on this.
<br><br>Christian<br><br><br><div class="gmail_quote">On Dec 19, 2007 8:33 PM, Gregory Hosler <<a href="mailto:ghosler@redhat.com">ghosler@redhat.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
-----BEGIN PGP SIGNED MESSAGE-----<br>Hash: SHA1<br><br>Hi all,<br><br>I've gone thru the devhelp documentation on libnotify, and have been<br>able to successfully incorporate libnotify into my application.<br><br>I am curious as regards to releasing the memory / structures that are
<br>used by a NotifyNotification.<br><br>My code is as follows:<br><br> NotifyNotification* my_popup;<br> GdkPixbufLoader *my_loader;<br> GdkPixbuf *jpg_pixbuf;<br> GError *my_error;<br> int rv;
<br><br> my_popup=notify_notification_new(mytitle, mymsg, NULL,<br>systray_get_widget());<br> if (icon_pixbuf) {<br> notify_notification_set_icon_from_pixbuf(my_popup, icon_pixbuf);<br> g_object_unref(icon_pixbuf);
<br> }<br> notify_notification_set_timeout(my_popup, timeout);<br> my_error = 0;<br> rv = notify_notification_show(my_popup, &my_error);<br><br><br>Everything works as expected. The notifications show, they timeout and
<br>disappear. But it seems as though they are never freed/destroyed. When I<br>run valgrind on my application, I am seeing:<br><br>==6969== 10,240 bytes in 5 blocks are still reachable in loss record<br>13,858 of 13,883<br>
==6969== at 0x4005622: realloc (vg_replace_malloc.c:306)<br>==6969== by 0x26B91A: g_realloc (gmem.c:168)<br>==6969== by 0x24601F: g_array_maybe_expand (garray.c:339)<br>==6969== by 0x2467D8: g_array_append_vals (
garray.c:132)<br>==6969== by 0xA9487E: (within /usr/lib/libdbus-glib-1.so.2.1.0)<br>==6969== by 0xA937A3: (within /usr/lib/libdbus-glib-1.so.2.1.0)<br>==6969== by 0x3B8569: g_value_copy (gvalue.c:119)<br>==6969== by 0x3B8B3B: g_value_array_insert (
gvaluearray.c:177)<br>==6969== by 0x3B8C5D: g_value_array_append (gvaluearray.c:153)<br>==6969== by 0xDEF822: notify_notification_set_icon_from_pixbuf<br>(notification.c:894)<br><br>as well as a number of other of instances of "still reachable in loss
<br>record" ...<br><br>So my question is: what happens when the notification "times out". Is it<br>destroyed ?<br><br>Same question when you click on teh notification to dismiss it.<br><br>Are there any objects that are put into the notification that need to be
<br>"unref"'ed ?<br><br>Thank you, and best rgds,<br><br>- -Greg<br><br>- --<br>+---------------------------------------------------------------------+<br><br>Please also check the log file at "/dev/null" for additional information.
<br> (from /var/log/Xorg.setup.log)<br><br>| Greg Hosler <a href="mailto:ghosler@redhat.com">ghosler@redhat.com</a> |<br>+---------------------------------------------------------------------+
<br>-----BEGIN PGP SIGNATURE-----<br>Version: GnuPG v1.4.7 (GNU/Linux)<br>Comment: Using GnuPG with Fedora - <a href="http://enigmail.mozdev.org" target="_blank">http://enigmail.mozdev.org</a><br><br>iD8DBQFHafCB404fl/0CV/QRArumAJ9XyGqeDmCBmlXKExV5h/ev138T+ACcDIO3
<br>+llrVQ8mJ1rnDv3czlp/z9g=<br>=F4Te<br>-----END PGP SIGNATURE-----<br>_______________________________________________<br>galago-devel mailing list<br><a href="mailto:galago-devel@lists.freedesktop.org">galago-devel@lists.freedesktop.org
</a><br><a href="http://lists.freedesktop.org/mailman/listinfo/galago-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/galago-devel</a><br></blockquote></div><br><br clear="all"><br>-- <br>Christian Hammond -
<a href="mailto:chipx86@chipx86.com">chipx86@chipx86.com</a><br>VMware, Inc.