summaryrefslogtreecommitdiffstats
path: root/src/conn-avoid-ref.cpp
diff options
context:
space:
mode:
authormjwybrow <mjwybrow@users.sourceforge.net>2006-05-09 04:25:31 +0000
committermjwybrow <mjwybrow@users.sourceforge.net>2006-05-09 04:25:31 +0000
commitf67636be11702e437716368ca8d2fbe2e94d4a93 (patch)
tree1bcd9b86bea961851c570f720028a4d495a9845c /src/conn-avoid-ref.cpp
parentfix confusion of SP_CANVAS_BPATH with SP_CURVE_BPATH (diff)
downloadinkscape-f67636be11702e437716368ca8d2fbe2e94d4a93.tar.gz
inkscape-f67636be11702e437716368ca8d2fbe2e94d4a93.zip
* conn-avoid-ref.cpp: Fix a crashbug that could occur in files
containing connectors if they were loaded from the file chooser or from the recent file list. Fixes bug #1458820. (bzr r790)
Diffstat (limited to 'src/conn-avoid-ref.cpp')
-rw-r--r--src/conn-avoid-ref.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp
index d90eca49b..22ddb5425 100644
--- a/src/conn-avoid-ref.cpp
+++ b/src/conn-avoid-ref.cpp
@@ -74,14 +74,24 @@ void SPAvoidRef::handleSettingChange(void)
if (desktop == NULL) {
return;
}
+ if (sp_desktop_document(desktop) != item->document) {
+ // We don't want to go any further if the active desktop's document
+ // isn't the same as the document that this item is part of. This
+ // case can happen if a new document is loaded from the file chooser
+ // or via the recent file menu. In this case, we can end up here
+ // as a rersult of a sp_document_ensure_up_to_date performed on a
+ // document not yet attached to the active desktop.
+ return;
+ }
- Router *router = item->document->router;
-
if (new_setting == setting) {
// Don't need to make any changes
return;
}
+ setting = new_setting;
+ Router *router = item->document->router;
+
_transformed_connection.disconnect();
if (new_setting) {
_transformed_connection = item->connectTransformed(
@@ -110,7 +120,6 @@ void SPAvoidRef::handleSettingChange(void)
router->delShape(shapeRef);
shapeRef = NULL;
}
- setting = new_setting;
}