-
- Downloads
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>
Showing
- src/cardwidget.cc 1 addition, 0 deletionssrc/cardwidget.cc
- src/channelwidget.cc 1 addition, 0 deletionssrc/channelwidget.cc
- src/devicewidget.cc 1 addition, 0 deletionssrc/devicewidget.cc
- src/mainwindow.cc 6 additions, 0 deletionssrc/mainwindow.cc
- src/rolewidget.cc 1 addition, 0 deletionssrc/rolewidget.cc
- src/sinkinputwidget.cc 1 addition, 0 deletionssrc/sinkinputwidget.cc
- src/sinkwidget.cc 1 addition, 0 deletionssrc/sinkwidget.cc
- src/sourceoutputwidget.cc 1 addition, 0 deletionssrc/sourceoutputwidget.cc
- src/sourcewidget.cc 1 addition, 0 deletionssrc/sourcewidget.cc
- src/streamwidget.cc 1 addition, 0 deletionssrc/streamwidget.cc
Loading
Please register or sign in to comment