diff --git a/src/document.cpp b/src/document.cpp
index f69c480f75e4a3f108cfdc9ce792283d166a3d4f..c5fa71f2be0c1c0f6f3220655e3976fc3b301c0f 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
/** \class SPDocument
* SPDocument serves as the container of both model trees (agnostic XML
* and typed object tree), and implements all of the document-level
- * functionality used by the program. Many document level operations, like
+ * functionality used by the program. Many document level operations, like
* load, save, print, export and so on, use SPDocument as their basic datatype.
*
* SPDocument implements undo and redo stacks and an id-based object
#include "dir-util.h"
#include "unit-constants.h"
#include "prefs-utils.h"
+#include "libavoid/router.h"
#include "display/nr-arena-item.h"
_collection_queue = NULL;
+ // Initialise instance of connector router.
+ router = new Avoid::Router();
+
p = new SPDocumentPrivate();
p->iddef = g_hash_table_new(g_direct_hash, g_direct_equal);
keepalive = FALSE;
}
+ if (router) {
+ delete router;
+ router = NULL;
+ }
+
//delete this->_whiteboard_session_manager;
}
{
actionkey = NULL;
}
-
+
static SPDocument *
sp_document_create(Inkscape::XML::Document *rdoc,
gchar const *uri,
}
/**
- * Fetches document from URI, or creates new, if NULL; public document
+ * Fetches document from URI, or creates new, if NULL; public document
* appears in document list.
*/
SPDocument *
@@ -986,6 +995,9 @@ sp_document_remove_resource(SPDocument *document, gchar const *key, SPObject *ob
g_return_val_if_fail(object != NULL, FALSE);
g_return_val_if_fail(SP_IS_OBJECT(object), FALSE);
+ if (SP_OBJECT_IS_CLONED(object))
+ return FALSE;
+
rlist = (GSList*)g_hash_table_lookup(document->priv->resources, key);
g_return_val_if_fail(rlist != NULL, FALSE);
g_return_val_if_fail(g_slist_find(rlist, object), FALSE);