Image/instance cleanup for 3.6gamma (was Re: [GOODIE] fixObsolete-mir)

Michael Rueger michael at squeakland.org
Tue Aug 26 02:41:27 UTC 2003


Doug Way wrote:


> Any suggestions to add to this list?  Code snippets to do actual 
> cleanups would be very helpful, too.

Below some more code snippets from my cleanup code, some of that not 
suitable for the developer image though.

Michael

------------------

	Undeclared removeUnreferencedKeys.
	StandardScriptingSystem initialize.
	ScriptingSystem deletePrivateGraphics.
	Preferences initialize.
	(Object classPool at: #DependentsFields) size > 1
		ifTrue: [self error:'Still have dependents'].
	Undeclared isEmpty
		ifFalse: [self error:'Please clean out Undeclared'].

	"Dump all projects"
	Project allSubInstancesDo:[:prj|
		prj == Project current
			ifFalse:[Project deletingProject: prj]].
	Browser initialize.
	ChangeSorter removeChangeSetsNamedSuchThat:
		[:cs| cs name ~= Smalltalk changes name].
	Smalltalk changes clear.
	Smalltalk changes name: 'Unnamed1'.
	Smalltalk garbageCollect.
	"Reinitialize DataStream;
		it may hold on to some zapped entitities"
	DataStream initialize.
	"Remove existing player references"
	References keys do:[:k| References removeKey: k].

	Smalltalk garbageCollect.
	ScheduledControllers _ nil.
	Behavior flushObsoleteSubclasses.
	Smalltalk garbageCollect; garbageCollect.
	Smalltalk obsoleteBehaviors isEmpty
		ifFalse:[self error:'Still have obsolete behaviors'].

	"Reinitialize DataStream;
	it may hold on to some zapped entitities"
	DataStream initialize.
	Smalltalk fixObsoleteReferences.
	Smalltalk abandonTempNames.
	Smalltalk zapAllOtherProjects.
	Smalltalk forgetDoIts.
	Smalltalk flushClassNameCache.
	3 timesRepeat: [
		Smalltalk garbageCollect.
		Symbol compactSymbolTable.
	].




More information about the Squeak-dev mailing list