On file open, only destroy a previous session if really exists

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23349 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2013-10-29 19:25:52 +00:00
parent 7835e8cb3e
commit df299589d4

View File

@ -701,11 +701,14 @@ RESTART:
/* -------------- BEGIN CORE SESSION CODE ------------- */
/* -- this code is almost identical in FileOpen and FileSaveAs -- */
current_session = gnc_get_current_session();
qof_session_call_close_hooks(current_session);
gnc_hook_run(HOOK_BOOK_CLOSED, current_session);
gnc_close_gui_component_by_session (current_session);
gnc_clear_current_session();
if (gnc_current_session_exist())
{
current_session = gnc_get_current_session();
qof_session_call_close_hooks(current_session);
gnc_hook_run(HOOK_BOOK_CLOSED, current_session);
gnc_close_gui_component_by_session (current_session);
gnc_clear_current_session();
}
/* load the accounts from the users datafile */
/* but first, check to make sure we've got a session going. */