summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-01-14 19:00:14 +0000
committerDavid Robillard <d@drobilla.net>2012-01-14 19:00:14 +0000
commitcc8f467e99dafded9efb924dacebcb8a53473ec4 (patch)
tree95d826e1af160c4f081a8db7bdeb22b8b15b4936 /src
parent5efc7ae9c304d7e01cc00291e0857ced7d3582ba (diff)
downloadganv-cc8f467e99dafded9efb924dacebcb8a53473ec4.tar.gz
ganv-cc8f467e99dafded9efb924dacebcb8a53473ec4.tar.bz2
ganv-cc8f467e99dafded9efb924dacebcb8a53473ec4.zip
Fix errors on canvas and/or edge destruction.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@3941 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/Canvas.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Canvas.cpp b/src/Canvas.cpp
index febc671..e8484ad 100644
--- a/src/Canvas.cpp
+++ b/src/Canvas.cpp
@@ -598,7 +598,6 @@ GanvCanvasImpl::remove_edge(GanvEdge* edge)
_selected_edges.erase(edge);
_edges.erase(edge);
_dst_edges.erase(edge);
- gtk_object_destroy(GTK_OBJECT(edge));
}
}
@@ -1478,13 +1477,16 @@ Canvas::destroy()
FOREACH_ITEM(items, i) {
gtk_object_destroy(GTK_OBJECT(*i));
}
+ impl()->_items.clear();
+ GanvCanvasImpl::Edges edges = impl()->_edges; // copy
+ FOREACH_EDGE(edges, i) {
+ gtk_object_destroy(GTK_OBJECT(*i));
+ }
impl()->_edges.clear();
impl()->_selected_ports.clear();
impl()->_connect_port = NULL;
-
- impl()->_items.clear();
}
void
@@ -1503,7 +1505,7 @@ Canvas::remove_edge(Node* item1,
{
Edge* edge = get_edge(item1, item2);
if (edge) {
- impl()->remove_edge(edge->gobj());
+ gtk_object_destroy(GTK_OBJECT(edge->gobj()));
}
}