Hello Andreas,
Andreas Schiefer wrote:
> in a multithreaded OpenSG 2.0 application i get random crashes on
> Windows while on Linux everything works just fine.
yes, depending on build settings MS STL verifies access to standard
containers and catches this type of thing at runtime.
> The code causing the crashes is line 774 in OSGWindow.cpp (in
> OSG::Window::validateGLObject()):
>
> else if(_mfGlObjectLastRefresh[osgId] > _lastValidate[osgId])
>
> and the reason is that "osgID" is bigger than the size of the
> "_mfGlObjectLastRefresh" vector.
>
> As the sizes of some other vectors are already checked against "osgID"
> at the beginning of that function, I added the following lines somewhere
> at the top of validateGLObject() and that seems to fix the problem
> (though I don't know if it's correct to initialize it with 0):
>
> if(osgId >= _mfGlObjectLastRefresh.size())
> {
> _mfGlObjectLastRefresh.resize(osgId + 1, 0);
> }
I applied a fix along those lines in r2465.
Many thanks for the report, diagnosis and fix!
Cheers,
Carsten
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users