From: Vince Darley Date: Fri, 28 Sep 2001 11:36:08 +0000 (+0000) Subject: fix X-Git-Tag: vfs-1-2~102 X-Git-Url: http://privyetmir.co.uk/gitweb?a=commitdiff_plain;h=8d001a9216f0063de65678b369f3cb22752473f1;p=tclvfs fix --- diff --git a/generic/vfs.c b/generic/vfs.c index 83eca9f..428a05e 100644 --- a/generic/vfs.c +++ b/generic/vfs.c @@ -42,6 +42,9 @@ static int Vfs_RemoveVolume _ANSI_ARGS_((Tcl_Obj*)); * NULL if there are none. To improve Tcl's efficiency, * when there are no volumes, we keep this NULL rather * than as an empty list. + * + * We keep a refCount on this object whenever it is + * non-NULL. */ static Tcl_Obj *vfsVolumes = NULL; @@ -1182,6 +1185,7 @@ Vfs_RemoveVolume(volume) if (Tcl_IsShared(vfsVolumes)) { Tcl_Obj *oldVols = vfsVolumes; vfsVolumes = Tcl_DuplicateObj(oldVols); + Tcl_IncrRefCount(vfsVolumes); Tcl_DecrRefCount(oldVols); } /* Remove the element */