summaryrefslogtreecommitdiffstats
path: root/src/libavoid
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2014-06-29 23:20:09 +0000
committerJohan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>2014-06-29 23:20:09 +0000
commit7d8304daeb171edb3fa94897f158fa5f551d8078 (patch)
tree948a080132f67fd0965cda7a75e3b58426f315f2 /src/libavoid
parentnoop: fix bool type (C to C++) (diff)
downloadinkscape-7d8304daeb171edb3fa94897f158fa5f551d8078.tar.gz
inkscape-7d8304daeb171edb3fa94897f158fa5f551d8078.zip
fix crash bug with connectors
because of constructor "ConnRef(Router *router, const unsigned int id)", _srcVert and _dstVert can be NULL, and _active can be false. this constructor seems unfinished, but is used elsewhere in the code. hence the crash. Fixed bugs: - https://launchpad.net/bugs/977003 (bzr r13341.1.72)
Diffstat (limited to 'src/libavoid')
-rw-r--r--src/libavoid/connector.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/libavoid/connector.cpp b/src/libavoid/connector.cpp
index 8dcb66f2d..b8c99a48c 100644
--- a/src/libavoid/connector.cpp
+++ b/src/libavoid/connector.cpp
@@ -442,11 +442,11 @@ void ConnRef::makeActive(void)
void ConnRef::makeInactive(void)
{
- COLA_ASSERT(_active);
-
- // Remove from connRefs list.
- _router->connRefs.erase(_pos);
- _active = false;
+ if (_active) {
+ // Remove from connRefs list.
+ _router->connRefs.erase(_pos);
+ _active = false;
+ }
}
@@ -553,8 +553,12 @@ void ConnRef::unInitialise(void)
void ConnRef::removeFromGraph(void)
{
- _srcVert->removeFromGraph();
- _dstVert->removeFromGraph();
+ if (_srcVert) {
+ _srcVert->removeFromGraph();
+ }
+ if (_dstVert) {
+ _dstVert->removeFromGraph();
+ }
}