diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-11-09 15:43:08 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-11-09 15:43:08 (GMT) |
commit | 86d9383e5ac170ca8a034085bb778f6fd96b7755 (patch) | |
tree | e09d0af58bc14bc5977fbf9290cb6a563e4cac1e /unix/tkUnixXId.c | |
parent | 9cbf3bd7e0b72c3e4a5501f3259900b189879371 (diff) | |
download | tk-86d9383e5ac170ca8a034085bb778f6fd96b7755.zip tk-86d9383e5ac170ca8a034085bb778f6fd96b7755.tar.gz tk-86d9383e5ac170ca8a034085bb778f6fd96b7755.tar.bz2 |
Fix [5ee8af61e5ef8e233158a43459624f4ecf58a6fe|5ee8af61e5] on Unix: Window embedding can not work on 64-bit Unix and Windows
Diffstat (limited to 'unix/tkUnixXId.c')
-rw-r--r-- | unix/tkUnixXId.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/unix/tkUnixXId.c b/unix/tkUnixXId.c index ca2eb33..444be30 100644 --- a/unix/tkUnixXId.c +++ b/unix/tkUnixXId.c @@ -586,13 +586,23 @@ TkpScanWindowId( CONST char *string, Window *idPtr) { - int value; + int code; + Tcl_Obj obj; - if (Tcl_GetInt(interp, string, &value) != TCL_OK) { - return TCL_ERROR; + obj.refCount = 1; + obj.bytes = (char *) string; /* DANGER?! */ + obj.length = strlen(string); + obj.typePtr = NULL; + + code = Tcl_GetLongFromObj(interp, &obj, (long *)idPtr); + + if (obj.refCount > 1) { + Tcl_Panic("invalid sharing of Tcl_Obj on C stack"); + } + if (obj.typePtr && obj.typePtr->freeIntRepProc) { + obj.typePtr->freeIntRepProc(&obj); } - *idPtr = (Window) value; - return TCL_OK; + return code; } /* |