]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/conf-context.c
Heap: Interface cleanup
[libucw.git] / ucw / conf-context.c
index f4929644d5a74fb6da626c657d78724fc8a547d4..050e43baaf47fc218e83f74aaf20479d83d14eeb 100644 (file)
@@ -17,7 +17,7 @@ static struct cf_context cf_default_context;
 static void
 cf_init_context(struct cf_context *cc)
 {
 static void
 cf_init_context(struct cf_context *cc)
 {
-  cc->need_journal = 1;
+  cc->enable_journal = 1;
   clist_init(&cc->conf_entries);
 }
 
   clist_init(&cc->conf_entries);
 }
 
@@ -30,11 +30,13 @@ cf_new_context(void)
 }
 
 void
 }
 
 void
-cf_free_context(struct cf_context *cc)
+cf_delete_context(struct cf_context *cc)
 {
 {
-  // FIXME: Roll back all transactions
   ASSERT(!cc->is_active);
   ASSERT(cc != &cf_default_context);
   ASSERT(!cc->is_active);
   ASSERT(cc != &cf_default_context);
+  struct cf_context *prev = cf_switch_context(cc);
+  cf_revert();
+  cf_switch_context(prev);
   xfree(cc->parser);
   xfree(cc);
 }
   xfree(cc->parser);
   xfree(cc);
 }