Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Exception during the ICmpInitializable.OnShutdown event skips all remaining OnShutdowns #658

@Rick-van-Dam

Description

@Rick-van-Dam

Summary

A Exception during the ICmpInitializable.OnShutdown event will skip any ICmpInitializable.OnShutdown after that. Looking at the source code here its easy to see why since there is no try catch to prevent this from happening. This can cause all kinds of weird bugs such as events not being unsubscribed.

A solution would be to collect all exceptions and throw/log them after all Shutdowns have executed.

Consider applying this to all events.

How to reproduce

  • Download ShutdownSkipped.zip
  • Open and run it in the editor. Note that even though we have 2 components only 1 of them has its shutdown executed

Workaround

  • Prevent any Exceptions during this event.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EditorArea: Duality editor or support librariesFeatureIt doesn't exist yet, but I want itUsabilityRelated to API and UI usability

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions