diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-09-20 21:46:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-20 21:46:38 +0200 |
commit | db2d999ea54b49275a15cdbc420b12abd201afaf (patch) | |
tree | 15e1708bc525153ac6d99cd0d40255d373d523ac | |
parent | 76ca46d1f4ab42c9ea11b651a07274f4a471ab64 (diff) | |
parent | 3aa82c524f037305d8d90b45956c315268f43741 (diff) |
Merge pull request #22155 from LittleWhite-tb/21718-font-leak
Clear textures before setting new textures
-rw-r--r-- | scene/resources/font.cpp | 1 |
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()); |