Remembered another thing that was very confusing while I was debugging
this, the memory of std::string can be tricky because visual studio
uses a short string optimization, which means strings up to e.g. 15
characters do not actually allocate memory on the heap. So short
strings may work ok but longer ones not.

Brecht.

On Mon, Apr 8, 2013 at 6:14 PM, Brecht Van Lommel
<[email protected]> wrote:
> Hi Michel,
>
> We've had similar issues with Blender, and I don't have a good
> solution for it either. There's a lot of confusing information about
> this online, my understanding is that to avoid issues you must:
>
> * Ensure all the compiler flags match for the application and all libraries.
> * Build with /MD instead of /MT when using a DLL. Otherwise the DLL
> and main application will not use the same heap. /MT does work ok with
> a static OIIO library.
>
> It would be nice if the OIIO (and OSL) API would not use these STL
> data structures, but this of course involves major API compatibility
> breakage. So I'm not sure how practical this is.
>
> Brecht.
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to