aboutsummaryrefslogtreecommitdiff
path: root/src/gui/guiFormSpecMenu.cpp
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2019-09-24 19:05:28 +0200
committerGitHub <noreply@github.com>2019-09-24 19:05:28 +0200
commit26b39f1eae1f576669cbf49c6db94ef4ed8624df (patch)
treedd0a508d4d6987f2c667cbf342955f64ebbd02af /src/gui/guiFormSpecMenu.cpp
parentd77ea764768f5cde9e8f0781356a67d723aa7609 (diff)
downloadminetest-26b39f1eae1f576669cbf49c6db94ef4ed8624df.tar.gz
minetest-26b39f1eae1f576669cbf49c6db94ef4ed8624df.tar.bz2
minetest-26b39f1eae1f576669cbf49c6db94ef4ed8624df.zip
Fix some reference counters (memleak) (#8981)
Fix some reference counters (memleak) Map::dispatchEvent: Allocation safety using references
Diffstat (limited to 'src/gui/guiFormSpecMenu.cpp')
-rw-r--r--src/gui/guiFormSpecMenu.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index e8a7f546e..390c81bc1 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -1208,12 +1208,14 @@ void GUIFormSpecMenu::createTextField(parserData *data, FieldSpec &spec,
true, Environment, this, spec.fid, rect, is_editable, is_multiline);
e->drop();
} else {
- if (is_multiline)
+ if (is_multiline) {
e = new GUIEditBoxWithScrollBar(spec.fdefault.c_str(), true,
Environment, this, spec.fid, rect, is_editable, true);
- else if (is_editable)
+ e->drop();
+ } else if (is_editable) {
e = Environment->addEditBox(spec.fdefault.c_str(), rect, true,
this, spec.fid);
+ }
}
if (e) {