Skip to content

Commit

Permalink
fix/slipofthepen: missing renames and making use of finalize
Browse files Browse the repository at this point in the history
  • Loading branch information
drahnr committed Aug 1, 2018
1 parent 24e210e commit ed0c342
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
2 changes: 0 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ int main (int argc, char *argv[])

status = g_application_run (G_APPLICATION (app), argc, argv);

oregano_deallocate_memory ();

g_object_unref (app);
g_type_class_unref (class);

Expand Down
38 changes: 18 additions & 20 deletions src/oregano.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,24 @@ static void oregano_open (GApplication *application, GFile **files, gint n_files

static void oregano_finalize (GObject *object)
{
GList *iter;
Library *l;

cursors_shutdown ();

g_object_unref (oregano.settings);

// Free the memory used by the parts libraries
for (iter = oregano.libraries; iter; iter = iter->next) {
l = (Library *) iter->data;
g_free (l->name);
g_free (l->author);
g_free (l->version);
}
g_list_free_full (oregano.libraries, g_free);

clipboard_empty ();

G_OBJECT_CLASS (oregano_parent_class)->finalize (object);
}

Expand Down Expand Up @@ -202,23 +219,4 @@ static void oregano_application (GApplication *app, GFile *file)

if (oregano.show_splash && splash)
oregano_splash_done (splash, _ ("Welcome to Oregano"));
}

void oregano_deallocate_memory (void)
{
GList *iter;
Library *l;

g_object_unref (oregano.settings);

// Free the memory used by the parts libraries
for (iter = oregano.libraries; iter; iter = iter->next) {
l = (Library *) iter->data;
g_free (l->name);
g_free (l->author);
g_free (l->version);
}
g_list_free_full (oregano.libraries, g_free);

clipboard_empty ();
}
}
2 changes: 1 addition & 1 deletion src/sheet/create-wire.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct _CreateWireInfo
};

CreateWireInfo *create_wire_info_new (Sheet *sheet);
void create_wire_destroy (CreateWireInfo *wire_info);
void create_wire_info_destroy (CreateWireInfo *wire_info);
gboolean create_wire_setup (Sheet *sheet);
gboolean create_wire_orientationtoggle (Sheet *sheet);
gboolean create_wire_event (Sheet *sheet, GdkEvent *event, gpointer data);
Expand Down

0 comments on commit ed0c342

Please sign in to comment.