diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-03-13 21:55:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-13 21:55:52 +0100 |
commit | 7015027cbf6ee071198267b6f4ffc3f4e40dfdd5 (patch) | |
tree | ee57d4cc0caa3fb4dfca2f1a76d69de8b2070d9e /platform/windows/windows_terminal_logger.cpp | |
parent | 0e3aae00d88848f9e840f940959f2ecd05ed7a8a (diff) | |
parent | 838e7d0a8d49ac5d2d149acf7afc6b909f640485 (diff) |
Merge pull request #46900 from Ev1lbl0w/bugfix-malloc_calls
Replace malloc's with Godot's memalloc macro
Diffstat (limited to 'platform/windows/windows_terminal_logger.cpp')
-rw-r--r-- | platform/windows/windows_terminal_logger.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/platform/windows/windows_terminal_logger.cpp b/platform/windows/windows_terminal_logger.cpp index 56b620a6d9..c1f3827d15 100644 --- a/platform/windows/windows_terminal_logger.cpp +++ b/platform/windows/windows_terminal_logger.cpp @@ -53,7 +53,8 @@ void WindowsTerminalLogger::logv(const char *p_format, va_list p_list, bool p_er if (wlen < 0) return; - wchar_t *wbuf = (wchar_t *)malloc((len + 1) * sizeof(wchar_t)); + wchar_t *wbuf = (wchar_t *)memalloc((len + 1) * sizeof(wchar_t)); + ERR_FAIL_NULL_MSG(wbuf, "Out of memory."); MultiByteToWideChar(CP_UTF8, 0, buf, len, wbuf, wlen); wbuf[wlen] = 0; @@ -62,7 +63,7 @@ void WindowsTerminalLogger::logv(const char *p_format, va_list p_list, bool p_er else wprintf(L"%ls", wbuf); - free(wbuf); + memfree(wbuf); #ifdef DEBUG_ENABLED fflush(stdout); |