From 29fcd9fc6057ab5592252be5af5a2481d4704c3f Mon Sep 17 00:00:00 2001 From: hobbs Date: Sat, 22 Jun 2002 09:13:37 +0000 Subject: * generic/tkFont.c (TkFontPkgFree): changed panic on freeing fonts to an assert, and wrapped panic in #ifdef PURIFY. [Bug #568701] --- generic/tkFont.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/generic/tkFont.c b/generic/tkFont.c index 2643b1f..5ab4e46 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -11,13 +11,17 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFont.c,v 1.13 2002/01/17 05:13:11 dgp Exp $ + * RCS: @(#) $Id: tkFont.c,v 1.14 2002/06/22 09:13:37 hobbs Exp $ */ #include "tkPort.h" #include "tkInt.h" #include "tkFont.h" +#ifndef assert +#include +#endif + /* * The following structure is used to keep track of all the fonts that * exist in the current application. It must be stored in the @@ -435,9 +439,12 @@ TkFontPkgFree(mainPtr) fprintf(stderr, "Font %s still in cache.\n", Tcl_GetHashKey(&fiPtr->fontCache, searchPtr)); } + assert(fontsLeft == 0); +#ifdef PURIFY if (fontsLeft) { panic("TkFontPkgFree: all fonts should have been freed already"); } +#endif Tcl_DeleteHashTable(&fiPtr->fontCache); hPtr = Tcl_FirstHashEntry(&fiPtr->namedTable, &search); -- cgit v0.12