Tcl_RegisterConfig() creates a [pkgconfig]
command. Configuration values are stored
in a dictionary, and the [pkgconfig] command
provides read access to the dictionary.
When the [pkgconfig] command is
deleted from the interp, the dictionary
of data remains, it is not freed until
the interp is deleted. The elements
of the dictionary may be freed as they
are overwritten by a later call to
Tcl_RegisterConfig() on the same interp.
Besides an unbalanced cleanup, this
also opens the possibility of having
[pkgconfig] return data values that
are a mixture of different Tcl_RegisterConfig()
calls (possibly from multiple versions of
the same package?).
I think we want QueryConfigDelete() to
clear the dictionary of data.
Logged In: YES
user_id=75003
Agree. But we have a problem here. QueryConfigDelete does
not get the interp, but the dictionary you ask it to delete
is found only through the assoc data of an interp. So we
can't find the dict right now.
This requires a change to the client data of the command.
Instead of the package name, as done right now we have to
use a struct which contains the package name, and a
reference to the relevant interp. the name is required
everywhere, the interp is relevant only for the cleanup.
Logged In: YES
user_id=75003
This is not blocker for the a4 release IMHO.
Logged In: YES
user_id=80530
Originator: YES
status?
Logged In: YES
user_id=75003
Originator: NO
Nothing was done :(
I have no objections to deletion via QueryConfigDelete() when the command goes away.
Logged In: YES
user_id=80530
Originator: YES
Here's a patch for review.
File Added: 983501.patch
Logged In: YES
user_id=75003
Originator: NO
Patch looks good.
Logged In: YES
user_id=80530
Originator: YES
committed for 8.5.0