summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorhobbs <hobbs>2003-01-25 03:11:46 (GMT)
committerhobbs <hobbs>2003-01-25 03:11:46 (GMT)
commit1e3b29791372232d82e4b6b3e25f78c30ada8fd1 (patch)
tree991680014a9257c7d7b6a25302288b1e1e0eec7d /win
parent80aab32eda0748288e7530f8a011c093758a0322 (diff)
downloadtcl-1e3b29791372232d82e4b6b3e25f78c30ada8fd1.zip
tcl-1e3b29791372232d82e4b6b3e25f78c30ada8fd1.tar.gz
tcl-1e3b29791372232d82e4b6b3e25f78c30ada8fd1.tar.bz2
* win/tclWinDde.c (Dde_Init): clarified use of tsdPtr.
(DdeServerProc): better refcount handling of returnPackagePtr.
Diffstat (limited to 'win')
-rw-r--r--win/tclWinDde.c17
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);