From ffa5cc26e85ed18e635f1a686ac0f4bbf7a63f4e Mon Sep 17 00:00:00 2001 From: hobbs Date: Tue, 17 Dec 2002 21:35:55 +0000 Subject: * generic/tclNotify.c (TclFinalizeNotifier, Tcl_SetServiceMode): (Tcl_ThreadAlert): Check that the stub functions are non-NULL before calling them. They could be set to NULL by Tcl_SetNotifier. --- ChangeLog | 6 ++++++ generic/tclNotify.c | 14 ++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index dff32d3..a83cb5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-12-17 Jeff Hobbs + + * generic/tclNotify.c (TclFinalizeNotifier, Tcl_SetServiceMode): + (Tcl_ThreadAlert): Check that the stub functions are non-NULL + before calling them. They could be set to NULL by Tcl_SetNotifier. + 2002-12-16 David Gravereaux * generic/tclPipe.c (TclCleanupChildren): diff --git a/generic/tclNotify.c b/generic/tclNotify.c index a8754b0..a9bdebc 100644 --- a/generic/tclNotify.c +++ b/generic/tclNotify.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclNotify.c,v 1.9 2002/08/31 06:09:45 das Exp $ + * RCS: @(#) $Id: tclNotify.c,v 1.10 2002/12/17 21:35:56 hobbs Exp $ */ #include "tclInt.h" @@ -160,7 +160,9 @@ TclFinalizeNotifier() Tcl_MutexLock(&listLock); - tclStubs.tcl_FinalizeNotifier(tsdPtr->clientData); + if (tclStubs.tcl_FinalizeNotifier) { + tclStubs.tcl_FinalizeNotifier(tsdPtr->clientData); + } Tcl_MutexFinalize(&(tsdPtr->queueMutex)); for (prevPtrPtr = &firstNotifierPtr; *prevPtrPtr != NULL; prevPtrPtr = &((*prevPtrPtr)->nextPtr)) { @@ -721,7 +723,9 @@ Tcl_SetServiceMode(mode) oldMode = tsdPtr->serviceMode; tsdPtr->serviceMode = mode; - tclStubs.tcl_ServiceModeHook(mode); + if (tclStubs.tcl_ServiceModeHook) { + tclStubs.tcl_ServiceModeHook(mode); + } return oldMode; } @@ -1087,7 +1091,9 @@ Tcl_ThreadAlert(threadId) Tcl_MutexLock(&listLock); for (tsdPtr = firstNotifierPtr; tsdPtr; tsdPtr = tsdPtr->nextPtr) { if (tsdPtr->threadId == threadId) { - tclStubs.tcl_AlertNotifier(tsdPtr->clientData); + if (tclStubs.tcl_AlertNotifier) { + tclStubs.tcl_AlertNotifier(tsdPtr->clientData); + } break; } } -- cgit v0.12