summaryrefslogtreecommitdiff
path: root/src/gui/guiHyperText.cpp
diff options
context:
space:
mode:
authorDS <vorunbekannt75@web.de>2020-03-10 20:32:38 +0100
committerGitHub <noreply@github.com>2020-03-10 20:32:38 +0100
commitb42493fb4c40611020c9ded9b7af5b96dc4148bd (patch)
treeb61a502308b865fa3c1160129339aea9df65a005 /src/gui/guiHyperText.cpp
parent7a7bfdca7c2dcbfe40467f64544112551abd7316 (diff)
downloadminetest-b42493fb4c40611020c9ded9b7af5b96dc4148bd.tar.gz
minetest-b42493fb4c40611020c9ded9b7af5b96dc4148bd.tar.bz2
minetest-b42493fb4c40611020c9ded9b7af5b96dc4148bd.zip
Fix memory leak in GUIHyperText (#9489)
Diffstat (limited to 'src/gui/guiHyperText.cpp')
-rw-r--r--src/gui/guiHyperText.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/guiHyperText.cpp b/src/gui/guiHyperText.cpp
index 7b7d3a1b2..68fb8ea3d 100644
--- a/src/gui/guiHyperText.cpp
+++ b/src/gui/guiHyperText.cpp
@@ -109,7 +109,6 @@ ParsedText::ParsedText(const wchar_t *text)
m_root_tag.style["color"] = "#EEEEEE";
m_root_tag.style["hovercolor"] = m_root_tag.style["color"];
- m_tags.push_back(&m_root_tag);
m_active_tags.push_front(&m_root_tag);
m_style = m_root_tag.style;
@@ -174,7 +173,7 @@ ParsedText::ParsedText(const wchar_t *text)
ParsedText::~ParsedText()
{
- for (auto &tag : m_tags)
+ for (auto &tag : m_not_root_tags)
delete tag;
}
@@ -289,7 +288,7 @@ ParsedText::Tag *ParsedText::newTag(const std::string &name, const AttrsList &at
Tag *newtag = new Tag();
newtag->name = name;
newtag->attrs = attrs;
- m_tags.push_back(newtag);
+ m_not_root_tags.push_back(newtag);
return newtag;
}
@@ -1012,6 +1011,7 @@ GUIHyperText::GUIHyperText(const wchar_t *text, IGUIEnvironment *environment,
GUIHyperText::~GUIHyperText()
{
m_vscrollbar->remove();
+ m_vscrollbar->drop();
}
ParsedText::Element *GUIHyperText::getElementAt(s32 X, s32 Y)