1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

Typemap: Set init to false after each individual destructor

This commit is contained in:
Megamouse 2023-12-23 21:32:12 +01:00 committed by Elad Ashkenazi
parent 69238bfc23
commit 3f5a80d692
2 changed files with 12 additions and 2 deletions

View File

@ -135,7 +135,12 @@ namespace stx
// Destroy objects in reverse order
for (; _max; _max--)
{
(*--m_info)->destroy(*--m_order);
auto* info = *--m_info;
const u32 type_index = static_cast<const type_info<typeinfo>*>(info)->index();
info->destroy(*--m_order);
// Set init to false. We don't want other fxo to use this fxo in their destructor.
m_init[type_index] = false;
}
// Pointers should be restored to their positions

View File

@ -313,7 +313,12 @@ namespace stx
// Destroy objects in reverse order
for (; _max; _max--)
{
(*--m_info)->destroy(*--m_order);
auto* info = *--m_info;
const u32 type_index = static_cast<const type_info<typeinfo>*>(info)->index();
info->destroy(*--m_order);
// Set init to false. We don't want other fxo to use this fxo in their destructor.
m_init[type_index] = false;
}
// Pointers should be restored to their positions