aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2013-05-09 23:14:32 +0200
committerPilzAdam <pilzadam@minetest.net>2013-05-10 11:31:00 +0200
commitd859ad7ed7419ce858b4cb1fc02c681563145bdb (patch)
tree559010b9f486d38361fcb030352ea62a32fdeaac /src
parentee1155fe6d5683578294c0ea20a8a3a0bf8ecbe4 (diff)
downloadminetest-d859ad7ed7419ce858b4cb1fc02c681563145bdb.tar.gz
minetest-d859ad7ed7419ce858b4cb1fc02c681563145bdb.tar.bz2
minetest-d859ad7ed7419ce858b4cb1fc02c681563145bdb.zip
Fix gettext memory leaks
Diffstat (limited to 'src')
-rw-r--r--src/guiMainMenu.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp
index 48e41bb81..9966b9fa7 100644
--- a/src/guiMainMenu.cpp
+++ b/src/guiMainMenu.cpp
@@ -483,16 +483,20 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
{
core::rect<s32> rect(0, 0, 390, 20);
rect += m_topleft_client + v2s32(50, 10);
- Environment->addStaticText(wgettext("Favorites:"),
+ wchar_t* text = wgettext("Favorites:");
+ Environment->addStaticText(text,
rect, false, true, this, GUI_ID_SERVERLIST_TITLE);
+ delete[] text;
}
} else {
m_data->servers = ServerList::getOnline();
{
core::rect<s32> rect(0, 0, 390, 20);
rect += m_topleft_client + v2s32(50, 10);
- Environment->addStaticText(wgettext("Public Server List:"),
+ wchar_t* text = wgettext("Public Server List:");
+ Environment->addStaticText(text,
rect, false, true, this, GUI_ID_SERVERLIST_TITLE);
+ delete[] text;
}
}
#else
@@ -500,8 +504,10 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
{
core::rect<s32> rect(0, 0, 390, 20);
rect += m_topleft_client + v2s32(50, 10);
- Environment->addStaticText(wgettext("Favorites:"),
+ wchar_t* text = wgettext("Favorites:");
+ Environment->addStaticText(text,
rect, false, true, this, GUI_ID_SERVERLIST_TITLE);
+ delete[] text;
}
#endif
updateGuiServerList();
@@ -1372,9 +1378,11 @@ bool GUIMainMenu::OnEvent(const SEvent& event)
readInput(&cur);
if (getTab() == TAB_MULTIPLAYER && cur.address == L"")
{
+ wchar_t* text = wgettext("Address required.");
(new GUIMessageMenu(env, parent, -1, menumgr,
- wgettext("Address required."))
+ text)
)->drop();
+ delete[] text;
return true;
}
acceptInput();