Skip to content

Commit

Permalink
Gather project build finalisation code into cleanup_project_build()
Browse files Browse the repository at this point in the history
  • Loading branch information
ntrel committed Aug 23, 2019
1 parent 9f149be commit 142ed19
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/project.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,25 +418,28 @@ gboolean project_close(gboolean open_default)
}


static void destroy_project(gboolean open_default)
static void cleanup_project_build(void)
{
GSList *node;

g_return_if_fail(app->project != NULL);

g_signal_emit_by_name(geany_object, "project-before-close");

/* remove project filetypes build entries */
if (app->project->priv->build_filetypes_list != NULL)
{
g_ptr_array_foreach(app->project->priv->build_filetypes_list, remove_foreach_project_filetype, NULL);
g_ptr_array_free(app->project->priv->build_filetypes_list, FALSE);
}

/* remove project non filetype build menu items */
build_remove_menu_item(GEANY_BCS_PROJ, GEANY_GBG_NON_FT, -1);
build_remove_menu_item(GEANY_BCS_PROJ, GEANY_GBG_EXEC, -1);
}

static void destroy_project(gboolean open_default)
{
GSList *node;

g_return_if_fail(app->project != NULL);

g_signal_emit_by_name(geany_object, "project-before-close");

cleanup_project_build();
g_free(app->project->name);
g_free(app->project->description);
g_free(app->project->file_name);
Expand Down

0 comments on commit 142ed19

Please sign in to comment.