1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Replace some raw pointers with unique's or optional

This commit is contained in:
Ivan Savenko
2025-04-27 19:58:21 +03:00
parent 4bafab9ad4
commit c0fb1d1b3b
17 changed files with 47 additions and 86 deletions

View File

@@ -416,7 +416,8 @@ int main(int argc, char * argv[])
if(!settings["session"]["headless"].Bool())
{
CMessage::dispose();
vstd::clear_pointer(graphics);
delete graphics;
graphics = nullptr;
}
// must be executed before reset - since unique_ptr resets pointer to null before calling destructor
@@ -424,7 +425,8 @@ int main(int argc, char * argv[])
ENGINE.reset();
vstd::clear_pointer(LIBRARY);
delete LIBRARY;
LIBRARY = nullptr;
logConfigurator.deconfigure();
std::cout << "Ending...\n";