Branch: refs/heads/master Author: Nick Treleaven nick.treleaven@btinternet.com Committer: Nick Treleaven nick.treleaven@btinternet.com Date: Wed, 27 Aug 2014 15:10:59 UTC Commit: 355f0c804ebab24e03339aa6498bd7f0d79a7883 https://github.com/geany/geany/commit/355f0c804ebab24e03339aa6498bd7f0d79a78...
Log Message: ----------- Fix GLib warning 'app->project == NULL failed'
Occurred on Project->New with an existing project when closing an unsaved file was cancelled.
Modified Paths: -------------- src/project.c src/project.h
Modified: src/project.c 10 lines changed, 5 insertions(+), 5 deletions(-) =================================================================== @@ -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;
Modified: src/project.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -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);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).