Hi Laurens,

I am currently using the Tiff plugin (and others) with large files, and I
use the std::exception to catch the allocations problems (it allows me for
some process to know that there is an allocation problem, clear the object
cache, and try to load again for example). For me it's a method which works
with all plugins, but with your change, the tiff plugin will have a
different behavior, and I will not be able to know if the
ERROR_IN_READING_FILE comes from an allocation problem or not.

So I recommend to stay like now, having bad_allocations exceptions when we
cannot allocate a buffer, or to move all the plugins to check for
allocations problems and return a specific error for that. But having some
plugins returning an error and others throwing an exception can be really
confusing.

Cheers,

On Mon, Jul 21, 2008 at 4:10 PM, Laurens Voerman <[EMAIL PROTECTED]> wrote:

> Now with attachment I hope...
>
>
> Laurens Voerman wrote:
>
>> Hi Robert,
>> I made a few changes in src\osgPlugins\tiff\ReaderWriterTIFF.cpp to avoid
>> an unexpected program termination when using very lage textures. I an not
>> totally sure about the portability of "new(std::nothrow)" , I need it on my
>> WinXP/Visual studio 2008 Express system where the new operator throws an
>> exeption, instead of returning a null pointer.
>>
>>
>> Second change: return ERROR_IN_READING_FILE on failure seems more
>> appropriate to me.
>>
>> Greetings, Laurens.
>> _______________________________________________
>> osg-submissions mailing list
>> [email protected]
>>
>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>


-- 
Serge Lages
http://www.tharsis-software.com
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to