diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2014-06-29 23:27:37 +0000 |
|---|---|---|
| committer | Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl> | 2014-06-29 23:27:37 +0000 |
| commit | df0fdb31cb60c71777db0f75195e9f43cd8ba6c5 (patch) | |
| tree | 3058102a3980fdafcb8bb94b68bcc29b1e425874 /src/libavoid | |
| parent | Enable rendering of new filter blend modes (but don't add them to GUI). (diff) | |
| download | inkscape-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')
| -rw-r--r-- | src/libavoid/connector.cpp | 18 |
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(); + } } |
