From: Martin Mares Date: Sun, 15 Feb 2009 22:02:09 +0000 (+0100) Subject: Logging: Let log_close_all() ASSERT that all references are gone. X-Git-Tag: holmes-import~72 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=2bc61d56ea0e8a70fb3d15a51fbfbce013c9a648;p=libucw.git Logging: Let log_close_all() ASSERT that all references are gone. --- diff --git a/ucw/log-stream.c b/ucw/log-stream.c index f65373ce..1ca76a55 100644 --- a/ucw/log-stream.c +++ b/ucw/log-stream.c @@ -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);