Fixed saving world only when path is set on destroying a world
This commit is contained in:
parent
41299b6081
commit
84b9681f70
1 changed files with 10 additions and 7 deletions
|
@ -70,14 +70,16 @@ gm_world_finalize(GObject *object) {
|
||||||
GmWorld *world = GM_WORLD(object);
|
GmWorld *world = GM_WORLD(object);
|
||||||
gchar *tmp_dir;
|
gchar *tmp_dir;
|
||||||
|
|
||||||
gm_options_save(world->priv->options);
|
if (world->priv->path) {
|
||||||
gm_world_save_input_history(world);
|
gm_options_save(world->priv->options);
|
||||||
gm_triggers_save(world->priv->triggers);
|
gm_world_save_input_history(world);
|
||||||
|
gm_triggers_save(world->priv->triggers);
|
||||||
|
|
||||||
// Removing all tmp files
|
// Removing all tmp files
|
||||||
tmp_dir = g_strconcat(world->priv->path, "/tmp", NULL);
|
tmp_dir = g_strconcat(world->priv->path, "/tmp", NULL);
|
||||||
gm_directory_remove_all(tmp_dir, FALSE);
|
gm_directory_remove_all(tmp_dir, FALSE);
|
||||||
g_free(tmp_dir);
|
g_free(tmp_dir);
|
||||||
|
}
|
||||||
|
|
||||||
g_list_free_simple(world->priv->history);
|
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') {
|
if (*ptr == '\n') {
|
||||||
line[i] = '\n';
|
line[i] = '\n';
|
||||||
line[i + 1] = '\0';
|
line[i + 1] = '\0';
|
||||||
|
|
||||||
gm_world_log(world, LOG_MCP_IN, line);
|
gm_world_log(world, LOG_MCP_IN, line);
|
||||||
gm_world_process_line(world, line);
|
gm_world_process_line(world, line);
|
||||||
p = ptr + 1;
|
p = ptr + 1;
|
||||||
|
|
Reference in a new issue