summaryrefslogtreecommitdiffstats
path: root/win/tkWinWindow.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tkWinWindow.c')
-rw-r--r--win/tkWinWindow.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c
index 2b8eb41..dbac589 100644
--- a/win/tkWinWindow.c
+++ b/win/tkWinWindow.c
@@ -114,7 +114,12 @@ Tk_Window
Tk_HWNDToWindow(hwnd)
HWND hwnd;
{
- Tcl_HashEntry *entryPtr = Tcl_FindHashEntry(&windowTable, (char*)hwnd);
+ Tcl_HashEntry *entryPtr;
+ if (!initialized) {
+ Tcl_InitHashTable(&windowTable, TCL_ONE_WORD_KEYS);
+ initialized = 1;
+ }
+ entryPtr = Tcl_FindHashEntry(&windowTable, (char*)hwnd);
if (entryPtr != NULL) {
return (Tk_Window) Tcl_GetHashValue(entryPtr);
}