If the program terminates abruptly due to unhandled exceptions, destructor for global objects might not be called. This happens because operating system might not give enough time to cleanup resources properly.
Try using smart pointers for resource management to avoid such issues.