On 5/11/2018 11:38 PM, Larry Gritz wrote:
> Seeking any feedback on this:
>
> https://github.com/OpenImageIO/oiio/pull/1934
>
> The summary is that it proposes to change the creation functions for
ImageInput and ImageOutput, which currently return a raw pointer that
the caller is responsible for managing, switching to return a unique_ptr
with a proper deleter. I think I like it, but it's a breaking change so
I didn't want to do it without giving people plenty of chance to object.
Of course this is master only, won't affect any releases until this
becomes the next big release some months hence.
>
Why a unique_ptr specifically? This forces the concept of a singular
owner onto users of OIIO. A shared_ptr would work just as well, wouldn't
it? It would trade a bit of reference counting overhead for not imposing
a strict single owner.
As for heap corruption when free()ing from another module on Windows:
this is a topic that confuses me personally. Did you see that actually
happen with Windows 7 and later? I vaguely remember that this was
supposedly fixed in XP or Vista and I haven't experienced any issues
with it, either. I'd love to see some authoritative documentation or a
definitive example.
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org