Skip to content

Morphs not cleaned up when closing a MorphicProject #162

Description

@LinqLover

I observed missing clean-ups for at least the following morphs:

  • BlobMorph: AllBlobs
  • NebraskaListenerMorph: does not stop listening
  • SpectrumAnalyzerMorph: does not stop recording
  • WebCamMorph: does not close camera interface

Most morphs override at least one of delete, abandon, or outOfWorld:. When deleting a project, none of these messages is sent. For Squeak Wonderland, however, a hard-coded edge already exists:

	"The window in which the project is housed is about to deleted. Perform
	any necessary actions to prepare for deletion."

	| list |
	Smalltalk at: #WonderlandCameraMorph ifPresent:[:aClass |
		world submorphs do:   "special release for wonderlands"
					[:m | (m isKindOf: aClass)
							and: [m getWonderland release]]].
	"Remove Player classes and metaclasses owned by project"
	self myPlayerClasses do: [:playerCls | playerCls removeFromSystemUnlogged].

Maybe we should send a new message to all open morphs from this place? Morph>>outOfProject:/projectIsClosing:/abandonWithProject:/...?
It would be more elegant if morphs would not have to implement separate messages for morph closing and project deletion. Maybe we could split up Morph>>abandon to send a new cleanUpState or similar to self, send the same message from prepareForDelete, and advise overriders of abandon to consider overiding cleanUpState instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug[WHAT] Something isn't working as expected. Automated tests beneficial. :-morphic[SCOPE] The issue is related to the Morphic framework.user[SCOPE] It is for the (maybe non-programming) (end-) user: designer, artist, writer, gamer, ...

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions