-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add NOTIFICATION_PREDELETE_CLEANUP
notification to fix C# Dispose()
#83670
Add NOTIFICATION_PREDELETE_CLEANUP
notification to fix C# Dispose()
#83670
Conversation
New notification sent after `NOTIFICATION_PREDELETE` to let Objects cleanup at the very end, it should be the last notification sent.
@@ -801,6 +801,8 @@ class Object { | |||
NOTIFICATION_POSTINITIALIZE = 0, | |||
NOTIFICATION_PREDELETE = 1, | |||
NOTIFICATION_EXTENSION_RELOADED = 2, | |||
// Internal notification to send after NOTIFICATION_PREDELETE, not bound to scripting. | |||
NOTIFICATION_PREDELETE_CLEANUP = 3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be clearly reserved so future notifications don't use it, especially if we use a system based on registered values to track overlap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good solution and I am all for solving this problem and move forward. I think the following should be considered.
EDIT: I apologize, just realized you are not actually binding this, so its fine as is. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed with @reduz, seems good as a stopgap measure for the C# predelete, until we can have a more robust system.
Then we would remove that new notification - so PR reviewers should be aware of not letting it be exposed/used more internally, unless there's a very clear use case validated by the core team.
NOTIFICATION_PREDELETE_CLEANUP
notificationNOTIFICATION_PREDELETE_CLEANUP
notification to fix C# Dispose()
Thanks! |
New notification sent after
NOTIFICATION_PREDELETE
to let Objects cleanup at the very end, it should be the last notification sent.NOTIFICATION_PREDELETE
does not triggerExitTree
#83262 (comment). I think it's the easiest and safest thing to do and avoids having to revert FixObject::notification
order #78634.NOTIFICATION_PREDELETE_CLEANUP
is used by C# scripts to cleanup (callsDispose()
), instead ofNOTIFICATION_PREDELETE
. This ensures that it's the last thing we do, after disposing we can't do anything else with the C# instances.tree_exited
/_ExitTree()
can't be found. #82279.NOTIFICATION_PREDELETE
does not triggerExitTree
#83262.