summaryrefslogtreecommitdiffstats
path: root/generic/tclPathObj.c
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2004-09-29 22:17:28 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2004-09-29 22:17:28 (GMT)
commit6cd42534eb8e9ab72ca598391f20a89ee91256c7 (patch)
tree9a574faca8ab395bddcb8ebbfcba24f070a7296a /generic/tclPathObj.c
parent5168f3edd958f497f7c6d23b5d6e0ddf377bf31f (diff)
downloadtcl-6cd42534eb8e9ab72ca598391f20a89ee91256c7.zip
tcl-6cd42534eb8e9ab72ca598391f20a89ee91256c7.tar.gz
tcl-6cd42534eb8e9ab72ca598391f20a89ee91256c7.tar.bz2
Factorize out the code for freeing an object's internal rep.
Diffstat (limited to 'generic/tclPathObj.c')
-rw-r--r--generic/tclPathObj.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 9ce22e5..b210a50 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclPathObj.c,v 1.34 2004/09/27 15:00:40 vincentdarley Exp $
+ * RCS: @(#) $Id: tclPathObj.c,v 1.35 2004/09/29 22:17:30 dkf Exp $
*/
#include "tclInt.h"
@@ -1204,9 +1204,7 @@ TclFSMakePathRelative(interp, pathPtr, cwdPtr)
}
pathPtr->typePtr->updateStringProc(pathPtr);
}
- if ((pathPtr->typePtr->freeIntRepProc) != NULL) {
- (*pathPtr->typePtr->freeIntRepProc)(pathPtr);
- }
+ TclFreeIntRep(pathPtr);
}
fsPathPtr = (FsPath*)ckalloc((unsigned)sizeof(FsPath));
@@ -1308,9 +1306,7 @@ TclFSMakePathFromNormalized(interp, pathPtr, nativeRep)
}
pathPtr->typePtr->updateStringProc(pathPtr);
}
- if ((pathPtr->typePtr->freeIntRepProc) != NULL) {
- (*pathPtr->typePtr->freeIntRepProc)(pathPtr);
- }
+ TclFreeIntRep(pathPtr);
}
fsPathPtr = (FsPath*)ckalloc((unsigned)sizeof(FsPath));
@@ -1384,9 +1380,7 @@ Tcl_FSNewNativePath(fromFilesystem, clientData)
}
pathPtr->typePtr->updateStringProc(pathPtr);
}
- if ((pathPtr->typePtr->freeIntRepProc) != NULL) {
- (*pathPtr->typePtr->freeIntRepProc)(pathPtr);
- }
+ TclFreeIntRep(pathPtr);
}
fsPathPtr = (FsPath*)ckalloc((unsigned)sizeof(FsPath));
@@ -2252,9 +2246,7 @@ SetFsPathFromAny(interp, pathPtr)
/*
* Free old representation before installing our new one.
*/
- if (pathPtr->typePtr != NULL && pathPtr->typePtr->freeIntRepProc != NULL) {
- (pathPtr->typePtr->freeIntRepProc)(pathPtr);
- }
+ TclFreeIntRep(pathPtr);
PATHOBJ(pathPtr) = (VOID *) fsPathPtr;
PATHFLAGS(pathPtr) = 0;
pathPtr->typePtr = &tclFsPathType;