aboutsummaryrefslogtreecommitdiffstats
path: root/src/gui/MachinaCanvas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/MachinaCanvas.cpp')
-rw-r--r--src/gui/MachinaCanvas.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp
index 3413a9f..6de0217 100644
--- a/src/gui/MachinaCanvas.cpp
+++ b/src/gui/MachinaCanvas.cpp
@@ -170,8 +170,10 @@ MachinaCanvas::on_erase_object(SPtr<client::ClientObject> object)
{
const Raul::Atom& type = object->get(URIs::instance().rdf_type);
if (type.get<URIInt>() == URIs::instance().machina_Node) {
- // Destruction of the view will remove from the canvas
+ delete object->view();
+ object->set_view(NULL);
} else if (type.get<URIInt>() == URIs::instance().machina_Edge) {
+ remove_edge(dynamic_cast<Ganv::Edge*>(object->view()));
object->set_view(NULL);
} else {
std::cerr << "Unknown object type" << std::endl;