Is IMG_Load_RW freeing buffer created with new[] ? |
Is IMG_Load_RW freeing buffer created with new[] ? |
Jonny D
|
The rwops is only a handle for accessing the buffer data in a common way. It does not keep an extra copy of the buffer, so if you delete the buffer before the rwops, then you're effectively pulling the rug out from under the rwops. You will have to manually delete the buffer when you are all done with the rwops.
There's a PhysFS extension, physfsrwops, that you should use to avoid that extra buffer. That might help your use case here. Jonny D On Sunday, March 22, 2015, sanitowi wrote:
|
|||||||||||||
|
sanitowi
|
Thanks for your hint.
Are there some docs available for the physfsrwops extension? I have not found any yet.. For now I use a std::vector as buffer in the LoadFromZip function, return a copy of it and create the rwops in the calling function... |
|||||||||||
|
sanitowi
|
Ok, I was able to get it working with physfsrwops,
but there are two little problems. I opend another thread for that. https://forums.libsdl.org/viewtopic.php?p=47383#47383 |
|||||||||||
|