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

Vehicles: Additional cleanup #583

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

insunaa
Copy link
Contributor

@insunaa insunaa commented Jan 4, 2025

🍰 Pullrequest

This PR adds a Vehicle-Cleanup call in CleanupsBeforeDelete

@insunaa
Copy link
Contributor Author

insunaa commented Jan 4, 2025

Keeping this PR open for a bit longer to see if I find any more preventable crashes

m_vehicleInfo->Cleanup();
m_vehicleInfo = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the nullptr is unnecessary. It will happen when unit is deleted

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought so too, and then I had a crash
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I mean sure, that fails due to MANGOS_ASSERT(m_passengers.empty()); but I fail to see how calling destructor (by setting the ptr to nullptr) fixes that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because setting it to nullptr early means that IsVehicle() or if (m_vehicleInfo) returns false, both of which are used in other aspects of the cleanup.

I haven't yet been able to provoke this same crash again, the server has been running stably for ~2 hours now with no crashes since I added the = nullptr; and I'll keep it running some more to see if maybe the crash re-occurs. If it doesn't then I'll just assume setting it to nullptr fixed the issue. If it does I'll have to investigate some more. In any case this crash occurred as shown in the crashlog and I couldn't find any other reason for why passengers might not be empty when the crash occurred

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

Successfully merging this pull request may close these issues.

2 participants