summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3a94f93)
raw | patch | inline | side by side (parent: 3a94f93)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 21 Sep 2008 22:24:48 +0000 (22:24 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 21 Sep 2008 22:24:48 +0000 (22:24 +0000) |
src/ui/view/view.cpp | patch | blob | history |
diff --git a/src/ui/view/view.cpp b/src/ui/view/view.cpp
index 75b6c453b349096e539e76ed2409252a9f4fc877..1b498a846ec018112149d37bbeb6dd1ce5ded556 100644 (file)
--- a/src/ui/view/view.cpp
+++ b/src/ui/view/view.cpp
*/
View::~View()
{
- if (_doc) {
- inkscape_remove_document(_doc);
- }
_close();
}
if (_doc) {
_document_uri_set_connection.disconnect();
_document_resized_connection.disconnect();
- _doc = 0;
+ if (inkscape_remove_document(_doc)) {
+ // this was the last view of this document, so delete it
+ delete _doc;
+ }
+ _doc = NULL;
}
Inkscape::Verb::delete_all_view (this);
if (_doc) {
_document_uri_set_connection.disconnect();
_document_resized_connection.disconnect();
- inkscape_remove_document(_doc);
+ if (inkscape_remove_document(_doc)) {
+ // this was the last view of this document, so delete it
+ delete _doc;
+ }
}
inkscape_add_document(doc);