Tk Source Code

View Ticket
Login
Ticket UUID: 831627
Title: if embedded windows used, exit command causes a crash
Type: Bug Version: obsolete: 8.4.4
Submitter: pshabash Created on: 2003-10-28 09:07:55
Subsystem: 68. Win Window Operations Assigned To: chengyemao
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2004-12-17 22:09:51
Resolution: None Closed By: chengyemao
    Closed on: 2004-12-17 15:09:51
Description:
If I create any embedded windows in wish 8.4.4 (using 
the toplevel's -container and -use options), issuing the 
command "exit" will cause wish to pop the error 
message "TkGetOtherWindow couldn't find window" and 
then to crash.

For example, sourcing the following script will crash wish 
8.4.4:

    set parent [ toplevel .parent -container 1 ];
    
    set embedded [ toplevel .embedded -use [ winfo id 
$parent ] ];
    
    exit;

The problem seems to occur because the embedded 
windows list is not cleared properly.  File 
win/tkWinEmbed.c:

ThreadSpecificData *tsdPtr =  (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof
(ThreadSpecificData));

tsdPtr->firstContainerPtr

etc.
User Comments: chengyemao added on 2004-12-17 22:09:50:
Logged In: YES 
user_id=191079

This was due to an improper sequence of exit handler 
invoking during finalization.  CleanupContainerList should be 
invoked after DeleteWindowsExitProc to avoid panics and 
potential crashes.