Просмотр исходного кода

Merge pull request #22155 from LittleWhite-tb/21718-font-leak

Clear textures before setting new textures
Rémi Verschelde 7 лет назад
Родитель
Сommit
db2d999ea5
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      scene/resources/font.cpp

+ 1 - 0
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());