Tcl Source Code

View Ticket
Login
Ticket UUID: 1452058
Title: unload -keeplibrary prevents re-loading the extension
Type: Bug Version: obsolete: 8.5a4
Submitter: neoxed Created on: 2006-03-17 08:19:31
Subsystem: 40. Dynamic Loading Assigned To: kennykb
Priority: 9 Immediate Severity:
Status: Deleted Last Modified: 2006-03-24 05:18:39
Resolution: Duplicate Closed By: neoxed
    Closed on: 2006-03-23 22:18:39
Description:
Tcl Version: 8.5a4
OS Version: Windows XP SP2

Once an extension is unloaded with -keeplibrary I'm 
unable to load the extension again. This happens with 
any extension, but I'll use the bundled registry one 
to demonstrate.

Actual output:
LoadA: registry {registry tcl::tommath Tcl}
Unload: {} {tcl::tommath Tcl}
LoadB: {} {tcl::tommath Tcl}

Expected output:
LoadA: registry {registry tcl::tommath Tcl}
Unload: {} {tcl::tommath Tcl}
LoadB: registry {registry tcl::tommath Tcl}

When the load command is invoked afterwards (LoadB), 
it seems Tcl does not call the package's Init() 
procedure.
User Comments: neoxed added on 2006-03-24 05:18:39:
Logged In: YES 
user_id=1119750

My mistake, this is a duplicate of 1111134. I searched 
for "-keeplibrary" and no results were returned, so I 
assumed this issue had never been mentioned.

dgp added on 2006-03-23 10:39:44:
Logged In: YES 
user_id=80530


how is this related to 1111134 ?

neoxed added on 2006-03-20 12:23:29:
Logged In: YES 
user_id=1119750

After further investigation, the problem occurs at lines 
~255-260 in tclLoad.c. The load command will search through 
a list of loaded packages, and if the package is already 
loaded it returns.

Since the package is unloaded with -keeplibrary, it's entry 
remains in the package list.

neoxed added on 2006-03-17 15:19:59:

File Added - 171235: unload.tcl

Attachments: