diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2017-07-01 17:13:58 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2017-07-01 17:13:58 +0000 |
| commit | f19bf822a0c2a44ff6201e7d24c4646e2e98e4ed (patch) | |
| tree | 5459b5d6238a6788582d1fe944dedb300f0ee5d9 /src/conn-avoid-ref.cpp | |
| parent | Merge branch 'master' of gitlab.com:inkscape/inkscape (diff) | |
| parent | Merge branch 'master' of gitlab.com:inkscape/inkscape (diff) | |
| download | inkscape-f19bf822a0c2a44ff6201e7d24c4646e2e98e4ed.tar.gz inkscape-f19bf822a0c2a44ff6201e7d24c4646e2e98e4ed.zip | |
Merge branch 'master' of gitlab.com:Frigory33/inkscape
Diffstat (limited to 'src/conn-avoid-ref.cpp')
| -rw-r--r-- | src/conn-avoid-ref.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp index 71743fda5..5e7942f19 100644 --- a/src/conn-avoid-ref.cpp +++ b/src/conn-avoid-ref.cpp @@ -24,6 +24,7 @@ #include "sp-conn-end.h" #include "sp-path.h" #include "libavoid/router.h" +#include "libavoid/shape.h" #include "xml/node.h" #include "document.h" #include "desktop.h" @@ -57,12 +58,10 @@ SPAvoidRef::~SPAvoidRef() // If the document is being destroyed then the router instance // and the ShapeRefs will have been destroyed with it. - const bool routerInstanceExists = (item->document->router != NULL); + Router *router = item->document->router; - if (shapeRef && routerInstanceExists) { - // Deleting the shapeRef will remove it completely from - // an existing Router instance. - delete shapeRef; + if (shapeRef && router) { + router->deleteShape(shapeRef); } shapeRef = NULL; } @@ -117,17 +116,13 @@ void SPAvoidRef::handleSettingChange(void) GQuark itemID = g_quark_from_string(id); shapeRef = new Avoid::ShapeRef(router, poly, itemID); - - router->addShape(shapeRef); } } else { g_assert(shapeRef); - // Deleting the shapeRef will remove it completely from - // an existing Router instance. - delete shapeRef; + router->deleteShape(shapeRef); shapeRef = NULL; } } |
