From 222f1936586214bc889b7c079757cea005980657 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Sun, 6 Jan 2019 19:31:47 +0100 Subject: Remove unneeded unreferencing. Add check on reference count. --- src/file.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index 9e57c0658..255ed467b 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -146,8 +146,6 @@ SPDesktop *sp_file_new(const std::string &templ) sp_create_window(dtw, TRUE); SPDesktop* desktop = static_cast(dtw->view); - doc->doUnref(); - sp_namedview_window_from_document(desktop); sp_namedview_update_layers_from_document(desktop); @@ -230,12 +228,12 @@ bool sp_file_open(const Glib::ustring &uri, doc = nullptr; cancelled = true; } + if (desktop) { desktop->clearWaitingCursor(); } if (doc) { - SPDocument *existing = desktop ? desktop->getDocument() : nullptr; if (existing && existing->virgin && replace_empty) { @@ -252,9 +250,6 @@ bool sp_file_open(const Glib::ustring &uri, doc->virgin = FALSE; - // everyone who cares now has a reference, get rid of our`s - doc->doUnref(); - SPRoot *root = doc->getRoot(); // This is the only place original values should be set. @@ -1299,7 +1294,6 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, } } - doc->doUnref(); DocumentUndo::done(in_doc, SP_VERB_FILE_IMPORT, _("Import")); return new_obj; -- cgit v1.2.3