1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

fix memory leaks introduced by invalid gettext usage

This commit is contained in:
sapier 2013-04-07 19:15:17 +02:00 committed by kwolekr
parent cd27c8ef5d
commit 98182f6097
14 changed files with 344 additions and 146 deletions

View file

@ -105,8 +105,9 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
{
core::rect<s32> rect(0, 0, 110, 20);
rect += topleft_client + v2s32(35, ypos+6);
Environment->addStaticText(wgettext("Old Password"),
rect, false, true, this, -1);
wchar_t* text = wgettext("Old Password");
Environment->addStaticText(text, rect, false, true, this, -1);
delete[] text;
}
changeCtype("C");
{
@ -122,8 +123,9 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
{
core::rect<s32> rect(0, 0, 110, 20);
rect += topleft_client + v2s32(35, ypos+6);
Environment->addStaticText(wgettext("New Password"),
rect, false, true, this, -1);
wchar_t* text = wgettext("New Password");
Environment->addStaticText(text, rect, false, true, this, -1);
delete[] text;
}
changeCtype("C");
{
@ -138,8 +140,9 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
{
core::rect<s32> rect(0, 0, 110, 20);
rect += topleft_client + v2s32(35, ypos+6);
Environment->addStaticText(wgettext("Confirm Password"),
rect, false, true, this, -1);
wchar_t* text = wgettext("Confirm Password");
Environment->addStaticText(text, rect, false, true, this, -1);
delete[] text;
}
changeCtype("C");
{
@ -155,18 +158,22 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
{
core::rect<s32> rect(0, 0, 140, 30);
rect = rect + v2s32(size.X/2-140/2, ypos);
Environment->addButton(rect, this, ID_change, wgettext("Change"));
wchar_t* text = wgettext("Change");
Environment->addButton(rect, this, ID_change, text);
delete[] text;
}
ypos += 50;
{
core::rect<s32> rect(0, 0, 300, 20);
rect += topleft_client + v2s32(35, ypos);
wchar_t* text = wgettext("Passwords do not match!");
IGUIElement *e =
Environment->addStaticText(
wgettext("Passwords do not match!"),
text,
rect, false, true, this, ID_message);
e->setVisible(false);
delete[] text;
}
changeCtype("C");