Implemented automatic memory leak detection and reporting for CRT.

This commit is contained in:
2023-11-11 04:03:48 -06:00
parent 67a5288984
commit 380582dfeb
12 changed files with 31067 additions and 16 deletions
+17 -4
View File
@@ -18,8 +18,8 @@ std::vector<MenuComponent*>Menu::unhandledComponents;
///__/////////////////////////////////////////////////////////////////////////////////////////////
//| |////////////////////////////////////////////////////////////////////////////////////////////
//| |/////WARNING! If you are adding something here you likely are adding another container with MenuComponent pointers in it right now.
//| |/////Because we are handling raw pointers, you must also add this container to the list of iterating search removal contains that occur in the
//| |/////DESTRUCTOR of MenuComponents!!!!! THIS IS NOT A DRILL!
//| |/////Because we are handling raw pointers, you must also add this container to the list of iterating search removal containers that occur in the
//| |/////DESTRUCTOR of MenuComponents!!!!! (Go to MenuComponent::~MenuComponent()) THIS IS NOT A DRILL!
//|__|////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////
///__/////////////////////////////////////////////////////////////////////////////////////////////
@@ -648,5 +648,18 @@ bool Menu::IsMenuOpen(){
}
void Menu::CleanupAllMenus(){
}
for(auto key:Menu::menus){
Menu*menu=key.second;
for(auto componentKey:menu->components){
MenuComponent*component=componentKey.second;
component->Cleanup();
delete component;
}
menu->components.Reset();
menu->Cleanup();
delete menu;
}
Menu::menus.clear();
}
void Menu::Cleanup(){}