clear utf16 cache

this stops the unicode global cache from showing in the memleak output
This commit is contained in:
marauder2k7 2025-05-05 17:30:40 +01:00
parent 8926d1c32b
commit d8315267e8
4 changed files with 12 additions and 2 deletions

View file

@ -289,6 +289,11 @@ UTF8* createUTF8string( const UTF16* unistring)
return ret; return ret;
} }
void UTF16ClearCache()
{
sgUTF16Cache.clear();
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View file

@ -66,6 +66,8 @@ UTF16* createUTF16string( const UTF8 *unistring);
UTF8* createUTF8string( const UTF16 *unistring); UTF8* createUTF8string( const UTF16 *unistring);
void UTF16ClearCache();
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/// Functions that convert buffers of unicode code points, into a provided buffer. /// Functions that convert buffers of unicode code points, into a provided buffer.
/// - These functions are useful for working on existing buffers. /// - These functions are useful for working on existing buffers.
@ -138,4 +140,4 @@ const UTF8* getNthCodepoint(const UTF8 *unistring, const U32 n);
bool chompUTF8BOM( const char *inString, char **outStringPtr ); bool chompUTF8BOM( const char *inString, char **outStringPtr );
bool isValidUTF8BOM( U8 bom[4] ); bool isValidUTF8BOM( U8 bom[4] );
#endif // _UNICODE_H_ #endif // _UNICODE_H_

View file

@ -231,7 +231,7 @@ S32 TorqueMain(S32 argc, const char **argv)
// argv = argvFake; // argv = argvFake;
// } // }
#if !defined(TORQUE_DISABLE_MEMORY_MANAGER) #if defined( TORQUE_DEBUG ) && !defined(TORQUE_DISABLE_MEMORY_MANAGER)
Memory::init(); Memory::init();
#endif #endif
@ -257,6 +257,7 @@ S32 TorqueMain(S32 argc, const char **argv)
Platform::restartInstance(); Platform::restartInstance();
#if defined( TORQUE_DEBUG ) && !defined( TORQUE_DISABLE_MEMORY_MANAGER ) #if defined( TORQUE_DEBUG ) && !defined( TORQUE_DISABLE_MEMORY_MANAGER )
Memory::shutdown(); Memory::shutdown();
#endif #endif

View file

@ -317,6 +317,8 @@ void Platform::shutdown()
GFXDevice::destroy(); GFXDevice::destroy();
WinConsole::destroy(); WinConsole::destroy();
UTF16ClearCache();
} }
extern bool LinkConsoleFunctions; extern bool LinkConsoleFunctions;