summaryrefslogtreecommitdiff
path: root/conf/conf.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2023-01-19 13:24:12 +0100
committerMaria Matejka <mq@ucw.cz>2023-01-19 18:17:05 +0100
commit1127f19a7a12b162064b1f521acd5c0017fbcf89 (patch)
treec80db6f02d775cf1b29809ae3b5e5c1f7cd9fb33 /conf/conf.c
parent84c298465f6360a8694d4837f3420961ea321fa5 (diff)
parent140c534fb81d0e165b7d674e869c646455ed19d1 (diff)
Merge commit '140c534fb81d0e165b7d674e869c646455ed19d1' into thread-next
Diffstat (limited to 'conf/conf.c')
-rw-r--r--conf/conf.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/conf/conf.c b/conf/conf.c
index f27147e5..fc8e3c46 100644
--- a/conf/conf.c
+++ b/conf/conf.c
@@ -199,6 +199,23 @@ config_free(struct config *c)
rfree(c->pool);
}
+/**
+ * config_free_old - free stored old configuration
+ *
+ * This function frees the old configuration (%old_config) that is saved for the
+ * purpose of undo. It is useful before parsing a new config when reconfig is
+ * requested, to avoid keeping three (perhaps memory-heavy) configs together.
+ */
+void
+config_free_old(void)
+{
+ tm_stop(config_timer);
+ undo_available = 0;
+
+ config_free(old_config);
+ old_config = NULL;
+}
+
void
config_add_obstacle(struct config *c)
{