Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Segfault in TclOO destructor

Closed / Duplicate37efead06408d9aedd46d0e7f3eeb5910470e65eCreated 6 years agoUpdated 3 years ago
Descriptionplain2021-02-15 11:52:51
Reproducible segfault in TclOO destructor, when the object namespace delete triggers the destruction of child object instances which call back to the parent object (which still exists, but has lost its namespace):

oo::class create foo {
	variable nameseq

	method bar {} {
		bar create bar[incr nameseq] [self]
	}

	method baz {} {}
}

oo::class create bar {
	variable parent

	constructor a_parent {
		set parent $a_parent
	}

	destructor {
		$parent baz
	}
}

foo create f
f bar
f destroy

Affects all versions of TclOO I've tried (including latest core-8-branch from fossil)
dkfplain2024-05-23 10:37:08
Duplicate of [7842f33a5c]
Log in (anonymous is fine) to add a comment.