UTexture2d deletion

anonymous_user_60c9dc7d
Sat, 09 Dec 2017 03:14:02 +0000
Asset Creation

I create my texture using the following line

LoadedT2D = UTexture2D::CreateTransient(ImageWrapper->GetWidth(), ImageWrapper->GetHeight());

And it loads correctly. LoadedT2D is stored in a UProperty(). So as long as the class which holds this UProperty() lives this texture should live. But in my case this texture is never getting destroyed even when the class which holds the UProperty is destroyed (destructor is called).

When I used Rama’s tutorial (A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums) to print out the references. It prints out AssetImportData and this is printed right after I create my texture with CreateTransient(). How do I avoid this reference to delete my texture.

2 posts - 1 participant