summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 421fa7d)
raw | patch | inline | side by side (parent: 421fa7d)
author | joncruz <joncruz@users.sourceforge.net> | |
Wed, 21 Jan 2009 12:53:19 +0000 (12:53 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Wed, 21 Jan 2009 12:53:19 +0000 (12:53 +0000) |
Fixed to no longer emit signal from deleted instance. Might fix bug 271621
src/document.cpp | patch | blob | history | |
src/document.h | patch | blob | history |
diff --git a/src/document.cpp b/src/document.cpp
index 5b27272c6ea4e9a034e4743a766b2d6698c45beb..4f54870324b9232fc972ff3897f0ac0b50124826 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
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;
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();
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 99a887c6bda815406ebd090e0436457a754e0ea5..3ede5a3d0bdc7b4946162b7799595582ca3bec74 100644 (file)
--- a/src/document.h
+++ b/src/document.h
GSList *_collection_queue;
+ bool oldSignalsConnected;
+
void add_persp3d (Persp3D * const persp);
void remove_persp3d (Persp3D * const persp);