diff options
author | donal.k.fellows@manchester.ac.uk <dkf> | 2007-09-20 22:59:40 (GMT) |
---|---|---|
committer | donal.k.fellows@manchester.ac.uk <dkf> | 2007-09-20 22:59:40 (GMT) |
commit | faf7c27b977a228e6ffae8249c55b0b3a88a6afd (patch) | |
tree | c03418956b7682e229796f5a2de8d36f866b4b8f /generic | |
parent | 74a58b0839af8917e9618620499f60e43c9d8a03 (diff) | |
download | tk-faf7c27b977a228e6ffae8249c55b0b3a88a6afd.zip tk-faf7c27b977a228e6ffae8249c55b0b3a88a6afd.tar.gz tk-faf7c27b977a228e6ffae8249c55b0b3a88a6afd.tar.bz2 |
Only call callbacks that are not NULL. [Bug 1791052]
Diffstat (limited to 'generic')
-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, |