diff options
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r-- | generic/tkTextDisp.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index d5d827d..7e43bf1 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextDisp.c,v 1.65 2007/09/07 00:34:54 dgp Exp $ + * RCS: @(#) $Id: tkTextDisp.c,v 1.66 2007/09/20 22:59:40 dkf Exp $ */ #include "tkInt.h" @@ -1551,6 +1551,7 @@ LayoutDLine( */ TkTextLine *linePtr = TkBTreeNextLine(NULL, curIndex.linePtr); + if (linePtr != NULL) { dlPtr->logicalLinesMerged++; curIndex.byteIndex = 0; @@ -1609,11 +1610,15 @@ LayoutDLine( } FreeStyle(textPtr, chunkPtr->stylePtr); breakChunkPtr->nextPtr = chunkPtr->nextPtr; - (*chunkPtr->undisplayProc)(textPtr, chunkPtr); + if (chunkPtr->undisplayProc != NULL) { + (*chunkPtr->undisplayProc)(textPtr, chunkPtr); + } ckfree((char *) chunkPtr); } if (breakByteOffset != breakChunkPtr->numBytes) { - (*breakChunkPtr->undisplayProc)(textPtr, breakChunkPtr); + if (breakChunkPtr->undisplayProc != NULL) { + (*breakChunkPtr->undisplayProc)(textPtr, breakChunkPtr); + } segPtr = TkTextIndexToSeg(&breakIndex, &byteOffset); (*segPtr->typePtr->layoutProc)(textPtr, &breakIndex, segPtr, byteOffset, maxX, breakByteOffset, 0, |