mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-05-01 18:13:57 +00:00
Null out the actor's ROI pointer before deletion to prevent its destructor from dereferencing the already-freed ROI.
This commit is contained in:
parent
b3e73aa675
commit
e05a741840
@ -358,6 +358,7 @@ void LegoCharacterManager::ReleaseActor(const char* p_name)
|
|||||||
|
|
||||||
if (info != NULL) {
|
if (info != NULL) {
|
||||||
if (info->m_actor != NULL) {
|
if (info->m_actor != NULL) {
|
||||||
|
info->m_actor->SetROI(NULL, FALSE, FALSE);
|
||||||
info->m_actor->ClearFlag(LegoEntity::c_managerOwned);
|
info->m_actor->ClearFlag(LegoEntity::c_managerOwned);
|
||||||
delete info->m_actor;
|
delete info->m_actor;
|
||||||
}
|
}
|
||||||
@ -400,6 +401,7 @@ void LegoCharacterManager::ReleaseActor(LegoROI* p_roi)
|
|||||||
|
|
||||||
if (info != NULL) {
|
if (info != NULL) {
|
||||||
if (info->m_actor != NULL) {
|
if (info->m_actor != NULL) {
|
||||||
|
info->m_actor->SetROI(NULL, FALSE, FALSE);
|
||||||
info->m_actor->ClearFlag(LegoEntity::c_managerOwned);
|
info->m_actor->ClearFlag(LegoEntity::c_managerOwned);
|
||||||
delete info->m_actor;
|
delete info->m_actor;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user