summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-09-20 21:46:38 +0200
committerGitHub <noreply@github.com>2018-09-20 21:46:38 +0200
commitdb2d999ea54b49275a15cdbc420b12abd201afaf (patch)
tree15e1708bc525153ac6d99cd0d40255d373d523ac
parent76ca46d1f4ab42c9ea11b651a07274f4a471ab64 (diff)
parent3aa82c524f037305d8d90b45956c315268f43741 (diff)
Merge pull request #22155 from LittleWhite-tb/21718-font-leak
Clear textures before setting new textures
-rw-r--r--scene/resources/font.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp
index 50bf8f38f7..b78b3a6ffb 100644
--- a/scene/resources/font.cpp
+++ b/scene/resources/font.cpp
@@ -178,6 +178,7 @@ PoolVector<int> BitmapFont::_get_kernings() const {
void BitmapFont::_set_textures(const Vector<Variant> &p_textures) {
+ textures.clear();
for (int i = 0; i < p_textures.size(); i++) {
Ref<Texture> tex = p_textures[i];
ERR_CONTINUE(!tex.is_valid());