Closed planetis-m closed 1 month ago
Right that was done on purpose in order to be able to share resources, however this design hits a limit with temporaries. the fix isn't obvious.
Nah the fix is obvious you have reset and wasMoved, wasMoved is appropriate here.
It actually makes sense for these setters to only accept Weak* counterparts making it explicit that they are unmanaged resources.
On the other hand, it's not a weak resource, UnloadMaterial unloads both shader and all the textures... But if part of a Model, then it's not destroyed...
I am going full circle here, that's what the repo used in 88cd872 that's a year ago!
Also review getShapesTexture
and getFontDefault
.
The solution here is to make a setter with parameter constraints that disallow rvalues.
Somehow tmp are not sinked into the setter and a destructor call is generated in the outer scope.