pharo icon indicating copy to clipboard operation
pharo copied to clipboard

GC of Obsolete Classes not happening due to ReAddClassChange event

Open MarcusDenker opened this issue 3 months ago • 3 comments

The Refactoring engine holds a reference to the classbuilder in the ReAddClassChange event.

If you add a class and then remove it, the class will be Obsolete, but can not get GCed as long as the ReAddClassChange event object is alive.

MarcusDenker avatar Oct 31 '25 14:10 MarcusDenker

This means that this will not happen often (only if you add and remove, normally when you remove a class there will be no event around anymore for creation as the undo just hold onto 20 or so events)

MarcusDenker avatar Oct 31 '25 14:10 MarcusDenker

@balsa-sarenac I wonder if we could not hold the class name or a description instead of the class.

Ducasse avatar Nov 08 '25 08:11 Ducasse

Makes sense to do so, will have to take a closer look since I haven't worked on changes that much, so can't tell off the bat. I've added the issue to refactoring engine project to keep an eye on it.

balsa-sarenac avatar Nov 10 '25 09:11 balsa-sarenac