summaryrefslogtreecommitdiffstats
path: root/src/libavoid/connector.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2014-06-29 23:27:37 +0000
committerJohan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>2014-06-29 23:27:37 +0000
commitdf0fdb31cb60c71777db0f75195e9f43cd8ba6c5 (patch)
tree3058102a3980fdafcb8bb94b68bcc29b1e425874 /src/libavoid/connector.cpp
parentEnable rendering of new filter blend modes (but don't add them to GUI). (diff)
downloadinkscape-df0fdb31cb60c71777db0f75195e9f43cd8ba6c5.tar.gz
inkscape-df0fdb31cb60c71777db0f75195e9f43cd8ba6c5.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 r13444)
Diffstat (limited to 'src/libavoid/connector.cpp')
-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();
+ }
}