Fixed saving world only when path is set on destroying a world
This commit is contained in:
parent
41299b6081
commit
84b9681f70
|
@ -70,14 +70,16 @@ gm_world_finalize(GObject *object) {
|
|||
GmWorld *world = GM_WORLD(object);
|
||||
gchar *tmp_dir;
|
||||
|
||||
gm_options_save(world->priv->options);
|
||||
gm_world_save_input_history(world);
|
||||
gm_triggers_save(world->priv->triggers);
|
||||
if (world->priv->path) {
|
||||
gm_options_save(world->priv->options);
|
||||
gm_world_save_input_history(world);
|
||||
gm_triggers_save(world->priv->triggers);
|
||||
|
||||
// Removing all tmp files
|
||||
tmp_dir = g_strconcat(world->priv->path, "/tmp", NULL);
|
||||
gm_directory_remove_all(tmp_dir, FALSE);
|
||||
g_free(tmp_dir);
|
||||
// Removing all tmp files
|
||||
tmp_dir = g_strconcat(world->priv->path, "/tmp", NULL);
|
||||
gm_directory_remove_all(tmp_dir, FALSE);
|
||||
g_free(tmp_dir);
|
||||
}
|
||||
|
||||
g_list_free_simple(world->priv->history);
|
||||
|
||||
|
@ -850,6 +852,7 @@ on_gm_world_net_bytes_recv(GmNet *net, gchar *text, gint len,
|
|||
if (*ptr == '\n') {
|
||||
line[i] = '\n';
|
||||
line[i + 1] = '\0';
|
||||
|
||||
gm_world_log(world, LOG_MCP_IN, line);
|
||||
gm_world_process_line(world, line);
|
||||
p = ptr + 1;
|
||||
|
|
Reference in New Issue