-
Notifications
You must be signed in to change notification settings - Fork 395
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
EntityPrototypeView has become disposable #5466
EntityPrototypeView has become disposable #5466
Conversation
|
||
protected override void Dispose(bool disposing) | ||
{ | ||
base.Dispose(disposing); | ||
|
||
if (!disposing) | ||
return; | ||
|
||
if (_ourEntity is not null) | ||
EntMan.DeleteEntity(_ourEntity); | ||
} |
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.
ExitedTree handles this, it seems like you're having an issue elsewhere.
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.
ExitedTree handles this, it seems like you're having an issue elsewhere.
Before adding explicit entity deletion in the Dispose
method, DeleteAllThenGhost test was crashing with 100% chance. In debug mode, breakpoints and call stack I realized that the problem is in EntityPrototypeView, it generates undeletable entities. For some reason ExitedTree
method does not work. As I wrote in Discord, after adding Dispose
, the test started to pass.
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.
Seems like ExitedTree is not being called when it should be then?
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.
Seems like ExitedTree is not being called when it should be then?
It looks like, but Dispose
is enough for my PR to work
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 is not a good fix, find the real root cause.
I found the bug, I fixed it as far as my motivation goes. My PR will probably work. I don't really care why something doesn't work. If you are not satisfied with my solution - I can close the PR, and look for the root cause yourself. I won't do more than that. My PR is aimed at making my main PR work, not at fixing your engine. |
If you want to fix the other bug feel free to open another PR then. |
EntityPrototypeView does not delete an entity unless done manually via
SetPrototype(null)
. This causes the test to fail in space-wizards/space-station-14#32339.