diff options
author | Robin Gareus <robin@gareus.org> | 2017-01-20 03:13:41 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-01-20 03:13:41 +0100 |
commit | 6b5dce2c66554df2243d62ca06c93b9c9eefc8fa (patch) | |
tree | a6c24dcf966fc0cc1b99436f5ded799a0e3d003c /libs/gtkmm2ext/gtkmm2ext | |
parent | 4ee8a0e9fc2a35441e2bb016f173adf5e521660d (diff) |
Yet another pane pain: allow deleting children using forall_vfunc
We not only need to make sure the iterator remains valid, but also
the object pointed to.
Valgrind trace:
Invalid read of size 8
Gtkmm2ext::Pane::forall_vfunc(int, void (*)(_GtkWidget*, void*), void*) (pane.cc:617)
Gtk::Container_Class::forall_vfunc_callback(_GtkContainer*, int, void (*)(_GtkWidget*, void*), void*)
gtk_container_destroy (gtkcontainer.c:1073)
g_closure_invoke (gclosure.c:804)
...
g_object_run_dispose (gobject.c:1084)
Diffstat (limited to 'libs/gtkmm2ext/gtkmm2ext')
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/pane.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/gtkmm2ext/gtkmm2ext/pane.h b/libs/gtkmm2ext/gtkmm2ext/pane.h index d8367b36f6..88eb82041b 100644 --- a/libs/gtkmm2ext/gtkmm2ext/pane.h +++ b/libs/gtkmm2ext/gtkmm2ext/pane.h @@ -22,6 +22,7 @@ #include <vector> #include <algorithm> +#include <boost/shared_ptr.hpp> #include <stdint.h> @@ -55,7 +56,7 @@ class LIBGTKMM2EXT_API Pane : public Gtk::Container Child (Pane* p, Gtk::Widget* widget, uint32_t ms) : pane (p), w (widget), minsize (ms) {} }; - typedef std::vector<Child*> Children; + typedef std::vector<boost::shared_ptr<Child> > Children; Pane (bool horizontal); ~Pane(); |