Kaydet (Commit) 355f0c80 authored tarafından Nick Treleaven's avatar Nick Treleaven

Fix GLib warning 'app->project == NULL failed'

Occurred on Project->New with an existing project when closing an
unsaved file was cancelled.
üst 5964d2e0
......@@ -398,9 +398,9 @@ static void remove_foreach_project_filetype(gpointer data, gpointer user_data)
/* open_default will make function reload default session files on close */
void project_close(gboolean open_default)
gboolean project_close(gboolean open_default)
{
g_return_if_fail(app->project != NULL);
g_return_val_if_fail(app->project != NULL, FALSE);
/* save project session files, etc */
if (!write_config(FALSE))
......@@ -410,10 +410,11 @@ void project_close(gboolean open_default)
{
/* close all existing tabs first */
if (!document_close_all())
return;
return FALSE;
}
ui_set_statusbar(TRUE, _("Project \"%s\" closed."), app->project->name);
destroy_project(open_default);
return TRUE;
}
......@@ -659,8 +660,7 @@ gboolean project_ask_close(void)
_("Do you want to close it before proceeding?"),
_("The '%s' project is open."), app->project->name))
{
project_close(FALSE);
return TRUE;
return project_close(FALSE);
}
else
return FALSE;
......
......@@ -66,7 +66,7 @@ void project_new(void);
void project_open(void);
void project_close(gboolean open_default);
gboolean project_close(gboolean open_default);
void project_properties(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment