Skip to content
Tcl Source Code View Ticket
Login

View Ticket

tclsh exits when Tk interps deleted

Closed / Fixed486453ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2001-11-28 13:02:02
[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
dgpplain2001-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.
dgpplain2001-12-20 23:22:06
File Added - 14982: main.patch
dgpplain2001-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.
dgpplain2001-12-22 06:28:03
File Deleted - 14982:
dgpplain2001-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.
dgpplain2001-12-22 06:29:22
File Added - 15027: main.test
dgpplain2002-01-05 06:53:54
Logged In: YES 
user_id=80530

More work in progress.  Nearly done now.
Here's the updated patch...
dgpplain2002-01-05 06:53:55
File Deleted - 15026: 



File Added - 15512: main.patch
dgpplain2002-01-05 06:55:20
Logged In: YES 
user_id=80530

...and the updated tests file.
dgpplain2002-01-05 06:55:21
File Deleted - 15512: 



File Added - 15513: main.test
dgpplain2002-01-06 05:43:09
Logged In: YES 
user_id=80530

Here's the final version of the patch
dgpplain2002-01-06 05:43:10
File Deleted - 15027: 



File Added - 15548: main.patch
dgpplain2002-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.
dgpplain2002-01-06 05:57:33
Logged In: YES 
user_id=80530

committed to HEAD (8.4a4)
Log in (anonymous is fine) to add a comment.

Attachments: