-
Notifications
You must be signed in to change notification settings - Fork 302
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
base: master
Are you sure you want to change the base?
Conversation
Keeping this PR open for a bit longer to see if I find any more preventable crashes |
m_vehicleInfo->Cleanup(); | ||
m_vehicleInfo = nullptr; |
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 believe the nullptr is unnecessary. It will happen when unit is deleted
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.
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.
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.
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.
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
🍰 Pullrequest
This PR adds a Vehicle-Cleanup call in
CleanupsBeforeDelete