Tcl Source Code

View Ticket
Login
Ticket UUID: 486453
Title: tclsh exits when Tk interps deleted
Type: Bug Version: obsolete: 8.4a4
Submitter: nobody Created on: 2001-11-28 13:02:02
Subsystem: 50. Embedding Support Assigned To: dgp
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2002-01-06 05:57:33
Resolution: Fixed Closed By: dgp
    Closed on: 2002-01-05 22:57:33
Description:
[Based on my post to comp.lang.tcl]
[cf. <http://groups.google.com/groups?
hl=en&lr=lang_en&newwindow=1&selm=slrna087g6.sdm.dgp%
40clover.cam.nist.gov>]

I executed the following code after installing the
ActiveTcl8.3.4.1-8.win32-ix86.exe package from
ActiveState's web site.  The problem detailed below 
happens under Windows 2000 and Windows 98. I also got 
the same response when I compiled under Solaris 2.8.

tclsh83.exe
% interp create foo
% interp create bar
% load c:/program\ files/tcl/bin/tk83.dll Tk foo
% load c:/program\ files/tcl/bin/tk83.dll Tk bar
% interp delete foo
% interp delete bar

The load commands each cause a toplevel to appear, and 
interp eval commands allow widgets to be created in 
each toplevel, etc.

However, when the last interpreter is deleted, tclsh 
exits.  

If Tk is loaded into sub interpreters, the main
interpreter should not exit when all of the Tk
enabled sub interpreters are deleted. 

*********

This appears to be a bug in the Tcl_Main() routine.  
Please file a bug report at the Tcl project at 
SourceForge.net.

http://sf.net/projects/tcl/

File it under the Category "Application Embedding".

-- 
Don Porter
User Comments: dgp added on 2002-01-06 05:57:33:
Logged In: YES 
user_id=80530

committed to HEAD (8.4a4)

dgp added on 2002-01-06 05:46:13:

File Added - 15549: main.test

Logged In: YES 
user_id=80530

...and here's the final version of the new test suite file.

dgp added on 2002-01-06 05:43:10:

File Deleted - 15027: 



File Added - 15548: main.patch

dgp added on 2002-01-06 05:43:09:
Logged In: YES 
user_id=80530

Here's the final version of the patch

dgp added on 2002-01-05 06:55:21:

File Deleted - 15512: 



File Added - 15513: main.test

dgp added on 2002-01-05 06:55:20:
Logged In: YES 
user_id=80530

...and the updated tests file.

dgp added on 2002-01-05 06:53:55:

File Deleted - 15026: 



File Added - 15512: main.patch

dgp added on 2002-01-05 06:53:54:
Logged In: YES 
user_id=80530

More work in progress.  Nearly done now.
Here's the updated patch...

dgp added on 2001-12-22 06:29:22:

File Added - 15027: main.test

dgp added on 2001-12-22 06:29:21:
Logged In: YES 
user_id=80530

...and here's a new file to add to the test suite.

There's still more tests to be added.  Just wanted to
upload the work in progress.

dgp added on 2001-12-22 06:28:03:

File Deleted - 14982:

dgp added on 2001-12-22 06:28:02:

File Added - 15026: main.patch

Logged In: YES 
user_id=80530

Here's an updated patch that adds some tclTest.c code
to help with testing Tcl_Main and friends.

dgp added on 2001-12-20 23:22:06:

File Added - 14982: main.patch

dgp added on 2001-12-20 23:22:02:
Logged In: YES 
user_id=80530

Here's a patch that rewrites Tcl_Main to address
this bug and several other bugs and shortcomings.
It also brings the documentation up to date, and
fills in more details.  Still need some tests
before commit.

Attachments: