I am getting an error in the following scenario :
I have a typescript with an attribute of type cc.SpriteFrame which I then assign to the sprite frame property of a sprite component of a node.
In onDestroy of the typescript, I release the sprite frame asset.
I reload the same scene that I am currently in.
the scene doesn’t load for the second time(it loads just fine the first time). the second time I get the following error :
cannot read property ‘_format’ of null
when I dynamically load the sprite frame using loadres , I don’t get the error.
can someone tell me why this is happening?