From 5b6b792cd49d65536ee282ebeaac850ac64f12f9 Mon Sep 17 00:00:00 2001 From: treectrl Date: Sat, 28 Oct 2006 01:21:51 +0000 Subject: Fixed a bug with dynamic-option code incrementing the refcount of a NULL Tcl_Object. --- generic/tkTreeUtils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generic/tkTreeUtils.c b/generic/tkTreeUtils.c index 235714b..4c962ad 100644 --- a/generic/tkTreeUtils.c +++ b/generic/tkTreeUtils.c @@ -5,7 +5,7 @@ * * Copyright (c) 2002-2006 Tim Baker * - * RCS: @(#) $Id: tkTreeUtils.c,v 1.45 2006/10/26 03:00:32 treectrl Exp $ + * RCS: @(#) $Id: tkTreeUtils.c,v 1.46 2006/10/28 01:21:51 treectrl Exp $ */ #include "tkTreeCtrl.h" @@ -5059,7 +5059,8 @@ dbwin("DynamicCO_Set id=%d saveInternalPtr=%p save=%p\n", cd->id, saveInternalPt dbwin("saving object '%s'\n", *value ? Tcl_GetString(*value) : "NULL"); #endif *objPtrPtr = *value; - Tcl_IncrRefCount(*value); + if (*value != NULL) + Tcl_IncrRefCount(*value); } *(DynamicCOSave **) saveInternalPtr = save; -- cgit v0.12