diff options
author | hobbs <hobbs@noemail.net> | 2003-01-25 03:11:45 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2003-01-25 03:11:45 (GMT) |
commit | 5ce088c4efa413c74df5061ec02c14da20f3c634 (patch) | |
tree | 991680014a9257c7d7b6a25302288b1e1e0eec7d /win/tclWinDde.c | |
parent | f6ba75b8c0a965d25e6bb494ec58bb4f98d127e9 (diff) | |
download | tcl-5ce088c4efa413c74df5061ec02c14da20f3c634.zip tcl-5ce088c4efa413c74df5061ec02c14da20f3c634.tar.gz tcl-5ce088c4efa413c74df5061ec02c14da20f3c634.tar.bz2 |
* win/tclWinDde.c (Dde_Init): clarified use of tsdPtr.
(DdeServerProc): better refcount handling of returnPackagePtr.
FossilOrigin-Name: 07d56520cdb7eaed53ebab34034db255bb4ca8cc
Diffstat (limited to 'win/tclWinDde.c')
-rw-r--r-- | win/tclWinDde.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/win/tclWinDde.c b/win/tclWinDde.c index 44879b9..3cab397 100644 --- a/win/tclWinDde.c +++ b/win/tclWinDde.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: tclWinDde.c,v 1.11 2003/01/18 01:05:17 mdejong Exp $ + * RCS: @(#) $Id: tclWinDde.c,v 1.12 2003/01/25 03:11:46 hobbs Exp $ */ #include "tclPort.h" @@ -119,27 +119,20 @@ Dde_Init( Tcl_Interp *interp) { ThreadSpecificData *tsdPtr; - + if (!Tcl_InitStubs(interp, "8.0", 0)) { return TCL_ERROR; } Tcl_CreateObjCommand(interp, "dde", Tcl_DdeObjCmd, NULL, NULL); - tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData((Tcl_ThreadDataKey *) &dataKey, sizeof(ThreadSpecificData)); - - if (tsdPtr == NULL) { - tsdPtr = TCL_TSD_INIT(&dataKey); - tsdPtr->currentConversations = NULL; - tsdPtr->interpListPtr = NULL; - } + tsdPtr = TCL_TSD_INIT(&dataKey); + Tcl_CreateExitHandler(DdeExitProc, NULL); return Tcl_PkgProvide(interp, TCL_DDE_PACKAGE_NAME, TCL_DDE_VERSION); } - /* *---------------------------------------------------------------------- * @@ -627,6 +620,7 @@ DdeServerProc ( convPtr->returnPackagePtr = NULL; returnPackagePtr = ExecuteRemoteObject(convPtr->riPtr, ddeObjectPtr); + Tcl_IncrRefCount(returnPackagePtr); for (convPtr = tsdPtr->currentConversations; (convPtr != NULL) && (convPtr->hConv != hConv); convPtr = convPtr->nextPtr) { /* @@ -635,7 +629,6 @@ DdeServerProc ( } if (convPtr != NULL) { - Tcl_IncrRefCount(returnPackagePtr); convPtr->returnPackagePtr = returnPackagePtr; } else { Tcl_DecrRefCount(returnPackagePtr); |