]> mj.ucw.cz Git - libucw.git/commitdiff
Logging: Let log_close_all() ASSERT that all references are gone.
authorMartin Mares <mj@ucw.cz>
Sun, 15 Feb 2009 22:02:09 +0000 (23:02 +0100)
committerMartin Mares <mj@ucw.cz>
Sun, 15 Feb 2009 22:02:09 +0000 (23:02 +0100)
ucw/log-stream.c

index f65373ce9cf4fe92fdf45e54e1007a8f063febe4..1ca76a5567215da0b4c67179dc1bb8063f22ae38 100644 (file)
@@ -65,7 +65,11 @@ log_close_all(void)
 
   // Free all cached structures
   for (int i=0; i < log_streams_after; i++)
-    xfree(log_streams.ptr[i]);
+    {
+      struct log_stream *ls = log_streams.ptr[i];
+      ASSERT(ls->regnum < 0 || !ls->use_count);
+      xfree(ls);
+    }
 
   /* Back to the default state */
   lsbuf_done(&log_streams);