summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2009-01-21 12:53:19 +0000
committerjoncruz <joncruz@users.sourceforge.net>2009-01-21 12:53:19 +0000
commitf7812ece33c3aa3018e2ded057253f56d73969f9 (patch)
tree239c41e32d1cda6ed4b3d8092340bad13bc07e14 /src
parentuse our python from devlibs, do not assume the user has a python in path (diff)
downloadinkscape-f7812ece33c3aa3018e2ded057253f56d73969f9.tar.gz
inkscape-f7812ece33c3aa3018e2ded057253f56d73969f9.zip
Fixed to not emit signals from deleted object. May fix 271621.
Fixed to no longer emit signal from deleted instance. Might fix bug 271621 (bzr r7153)
Diffstat (limited to 'src')
-rw-r--r--src/document.cpp15
-rw-r--r--src/document.h2
2 files changed, 14 insertions, 3 deletions
diff --git a/src/document.cpp b/src/document.cpp
index 5b27272c6..4f5487032 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -93,7 +93,8 @@ SPDocument::SPDocument() :
router(new Avoid::Router()),
perspectives(0),
current_persp3d(0),
- _collection_queue(0)
+ _collection_queue(0),
+ oldSignalsConnected(false)
{
// Don't use the Consolidate moves optimisation.
router->ConsolidateMoves = false;
@@ -181,8 +182,14 @@ SPDocument::~SPDocument() {
modified_id = 0;
}
- _selection_changed_connection.disconnect();
- _desktop_activated_connection.disconnect();
+ if (oldSignalsConnected) {
+ g_signal_handlers_disconnect_by_func(G_OBJECT(INKSCAPE),
+ reinterpret_cast<gpointer>(sp_document_reset_key),
+ static_cast<gpointer>(this));
+ } else {
+ _selection_changed_connection.disconnect();
+ _desktop_activated_connection.disconnect();
+ }
if (keepalive) {
inkscape_unref();
@@ -385,9 +392,11 @@ sp_document_create(Inkscape::XML::Document *rdoc,
G_CALLBACK(sp_document_reset_key), document);
g_signal_connect(G_OBJECT(INKSCAPE), "activate_desktop",
G_CALLBACK(sp_document_reset_key), document);
+ document->oldSignalsConnected = true;
} else {
document->_selection_changed_connection = Inkscape::NSApplication::Editor::connectSelectionChanged (sigc::mem_fun (*document, &SPDocument::reset_key));
document->_desktop_activated_connection = Inkscape::NSApplication::Editor::connectDesktopActivated (sigc::mem_fun (*document, &SPDocument::reset_key));
+ document->oldSignalsConnected = false;
}
return document;
diff --git a/src/document.h b/src/document.h
index 99a887c6b..3ede5a3d0 100644
--- a/src/document.h
+++ b/src/document.h
@@ -110,6 +110,8 @@ struct SPDocument : public Inkscape::GC::Managed<>,
GSList *_collection_queue;
+ bool oldSignalsConnected;
+
void add_persp3d (Persp3D * const persp);
void remove_persp3d (Persp3D * const persp);