Fixed an issue that caused the texture to be released before it was wished