Skip to content

Commit

Permalink
Merge pull request #79981 from RandomShaper/fix_res_imp_life_2
Browse files Browse the repository at this point in the history
Fix life cycle of ResourceImporterTexture better
  • Loading branch information
aaronfranke authored Jul 29, 2023
2 parents 031aa99 + abd0dca commit 75f9c97
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions editor/import/resource_importer_texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,12 +790,16 @@ bool ResourceImporterTexture::are_import_settings_valid(const String &p_path) co
ResourceImporterTexture *ResourceImporterTexture::singleton = nullptr;

ResourceImporterTexture::ResourceImporterTexture() {
singleton = this;
if (!singleton) {
singleton = this;
}
CompressedTexture2D::request_3d_callback = _texture_reimport_3d;
CompressedTexture2D::request_roughness_callback = _texture_reimport_roughness;
CompressedTexture2D::request_normal_callback = _texture_reimport_normal;
}

ResourceImporterTexture::~ResourceImporterTexture() {
singleton = nullptr;
if (singleton == this) {
singleton = nullptr;
}
}

0 comments on commit 75f9c97

Please sign in to comment.