diff options
Diffstat (limited to 'generic/tkTextBTree.c')
-rw-r--r-- | generic/tkTextBTree.c | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c index 22d91c7..b2db5aa 100644 --- a/generic/tkTextBTree.c +++ b/generic/tkTextBTree.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextBTree.c,v 1.10 2003/11/08 17:22:46 vincentdarley Exp $ + * RCS: @(#) $Id: tkTextBTree.c,v 1.11 2003/12/15 11:51:06 vincentdarley Exp $ */ #include "tkInt.h" @@ -55,7 +55,9 @@ typedef struct Node { int numChildren; /* Number of children of this node. */ int numLines; /* Total number of lines (leaves) in * the subtree rooted here. */ - int numPixels; + int numPixels; /* Total number of vertical + * display pixels in the + * subtree rooted here. */ } Node; /* @@ -2837,13 +2839,14 @@ TkTextIsElided(textPtr, indexPtr, elideInfo) } } - if (LOTSA_TAGS < infoPtr->numTags) { - ckfree((char *) infoPtr->tagCnts); - ckfree((char *) infoPtr->tagPtrs); - } elide = infoPtr->elide; - + if (elideInfo == NULL) { + if (LOTSA_TAGS < infoPtr->numTags) { + ckfree((char *) infoPtr->tagCnts); + ckfree((char *) infoPtr->tagPtrs); + } + ckfree((char*) infoPtr); } @@ -2853,6 +2856,34 @@ TkTextIsElided(textPtr, indexPtr, elideInfo) /* *---------------------------------------------------------------------- * + * TkTextFreeElideInfo -- + * + * This is a utility procedure used to free up any memory + * allocated by the TkTextIsElided function above. + * + * Results: + * None. + * + * Side effects: + * Memory may be freed. + * + *---------------------------------------------------------------------- + */ + +void +TkTextFreeElideInfo(elideInfo) + TkTextElideInfo *elideInfo; /* Free any allocated memory in this + * structure. */ +{ + if (LOTSA_TAGS < elideInfo->numTags) { + ckfree((char*)elideInfo->tagCnts); + ckfree((char*)elideInfo->tagPtrs); + } +} + +/* + *---------------------------------------------------------------------- + * * IncCount -- * * This is a utility procedure used by TkBTreeGetTags. It |