Fixed a bug that prevented BaseTextures to be destroyed