Skip to content
Tcl Source Code View Ticket
Login

View Ticket

unload -keeplibrary prevents re-loading the extension

Deleted1452058fffffffffffffffffffffffffffffffffCreated 21 years agoUpdated 21 years ago
Descriptionplain2006-03-17 08:19:31
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.
neoxedplain2006-03-17 15:19:59
File Added - 171235: unload.tcl
neoxedplain2006-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 Ticket [1452058fff]: 1 change [History diff]2006-03-23 07:21:37
dgpplain2006-03-23 10:39:44
Logged In: YES 
user_id=80530


how is this related to 1111134 ?
neoxed Deleted ticket [1452058fff]. [History diff]2006-03-24 05:18:38
neoxedplain2006-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.
Log in (anonymous is fine) to add a comment.

Attachments: