Skip to content
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

Closed

Conversation

Ertanic
Copy link

@Ertanic Ertanic commented Sep 27, 2024

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.

Comment on lines +59 to +69

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);

if (!disposing)
return;

if (_ourEntity is not null)
EntMan.DeleteEntity(_ourEntity);
}
Copy link
Contributor

@metalgearsloth metalgearsloth Sep 28, 2024

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.

Copy link
Author

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.

Copy link
Contributor

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?

Copy link
Author

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

Copy link
Member

@PJB3005 PJB3005 left a 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.

@Ertanic
Copy link
Author

Ertanic commented Sep 29, 2024

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.

@metalgearsloth
Copy link
Contributor

If you want to fix the other bug feel free to open another PR then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants