Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2021-06-09
10:25 • Ticket [e39cb3f462] namespace is removed from other namespace paths before delet... artifact: 62eacf848a user: pooryorick
2021-05-19
10:46
fix for [e39cb3f462631a99], namespace is removed from other namespace paths before deletion is compl... check-in: 949252950f user: pooryorick tags: core-8-branch
07:16 • Ticket [e39cb3f462] namespace is removed from other namespace paths before delet... artifact: a7f70676da user: pooryorick
07:15
new test for issue [e39cb3f462631a99], namespace is removed from other namespace paths before deleti... check-in: b0e2b4520c user: pooryorick tags: bug-e39cb3f462631a99
2021-05-18
22:09
Fix for issue [e39cb3f462631a99], namespace is removed from other namespace paths before deletion is... check-in: bdd005f330 user: pooryorick tags: bug-e39cb3f462631a99
21:43 • New ticket [e39cb3f462] namespace is removed from other namespace paths before d... artifact: 62868ca95d user: pooryorick

namespace is removed from other namespace paths before deletion is complete

Opene39cb3f462631a9973e48d27cf5098ca6b537aafCreated 6 years agoUpdated 5 years ago
Descriptionwiki2021-05-18 21:43:56
At least up until commit [2e5531f5f88d047f], in the following script, the command being deleted is succesfully called during first trace, but not during the second trace. The difference is that in the second script "p1" is not resolved even though ns2, which is in the process of being deleted, is in the path. The namespace is not yet fully deleted though, and p1 should still exist because the trace on it is still in progress. The success of the first trigger illustrates that the name still exists and that the routine can still be accessed using a fully-qualified name. Likewise, "p1" should be succesfully resolved during the second trigger.

A related test case, namespace-51.13, includes an old comment asking whether the outcome of the test should instead be what is proposed here.

namespace eval ns1 {
	proc p1 caller {
		lappend [namespace parent]::res $caller
	}
}


namespace eval ns1a {
	namespace path [namespace parent]::ns1

	proc t1 {old new op} {
		$old t1
	}
}

namespace eval ns2 {
	proc p1 caller {
		lappend [namespace parent]::res $caller
	}
}

namespace eval ns2a {
	namespace path [namespace parent]::ns2

	proc t1 {old new op} {
		[namespace tail $old] t2
	}
}


trace add command ns1::p1 delete ns1a::t1
namespace delete ns1

trace add command ns2::p1 delete ns2a::t1
namespace delete ns2

puts $res ;# -> t1 
pooryorickwiki2021-05-19 07:16:08

Fixed in [bdd005f3301eec51].

pooryorick Ticket [e39cb3f462]: 3 changes [History diff]2021-06-09 10:25:34
Log in (anonymous is fine) to add a comment.