Commit Graph

6 Commits

Author SHA1 Message Date
Hans de Goede b2362f2223 Reference the widget before returning it from ::create methods
Widgets (unlike Windows and Dialogs) returned by Gtk::Builder::get_widget*
start owned by the GtkBuilder object, the idea being that they will get
added to a container before the scope of the GtkBuilder object ends, and it
thus automatically gets destroyed.

But in the various ::create methods in pavucontrol, a pointer to the widget
gets returned, so that it can be added to a cointainer by the caller.
However as soon as the ::create method exits the GtkBuilder object owning
the widget, and thus also the widget gets destroyed, and we end up returning
free-ed memory.

This commit fixes this by making all ::create methods take a reference on
the widget before returning it, and having all the callers unreference the
widget after adding it to a container.

https://bugs.freedesktop.org/show_bug.cgi?id=83144
https://bugzilla.redhat.com/show_bug.cgi?id=1133339

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-09-07 13:51:27 +03:00
Rafał Mużyło 9ce0e0a380 Drop the need to use libglademm 2011-03-03 14:31:14 +00:00
Colin Guthrie dc2eb66e0a Order the card profiles by their priority 2009-03-25 21:10:21 +00:00
Colin Guthrie c4208bfd8e Use C style comments as per Lennart's fetish :p 2009-03-18 21:01:03 +00:00
Colin Guthrie c6b73de308 Move config.h inclusion to the .cc files 2009-03-18 20:58:17 +00:00
Colin Guthrie d3a66f65b5 Split cardwidget out into it's own files.
Also define a get_context() method to get the context from outside of the main file.
2009-03-15 13:32:28 +00:00