From 98182f6097ec0568545f5612f6ae1354e110333d Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 7 Apr 2013 19:15:17 +0200 Subject: fix memory leaks introduced by invalid gettext usage --- src/guiVolumeChange.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/guiVolumeChange.cpp') diff --git a/src/guiVolumeChange.cpp b/src/guiVolumeChange.cpp index cfb89da1c..4e92b82c2 100644 --- a/src/guiVolumeChange.cpp +++ b/src/guiVolumeChange.cpp @@ -105,8 +105,10 @@ void GUIVolumeChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 120, 20); rect = rect + v2s32(size.X/2-60, size.Y/2-35); - Environment->addStaticText(wgettext("Sound Volume: "), rect, false, + wchar_t* text = wgettext("Sound Volume: "); + Environment->addStaticText(text, rect, false, true, this, ID_soundText1); + delete[] text; } { core::rect rect(0, 0, 30, 20); @@ -117,8 +119,10 @@ void GUIVolumeChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 80, 30); rect = rect + v2s32(size.X/2-80/2, size.Y/2+55); + wchar_t* text = wgettext("Exit"); Environment->addButton(rect, this, ID_soundExitButton, - wgettext("Exit")); + text); + delete[] text; } { core::rect rect(0, 0, 300, 20); -- cgit v1.2.3