[osg-users] SetAttribute crash...

neil.hughes at tesco.net neil.hughes at tesco.net
Mon Mar 23 02:59:27 PDT 2009

Hi All,

I have a standalone windows application (MDI) that embeds OSG in a window, loads an object, applies a texture, and displays the object for viewing. This works fine. No problems at all.

I've also got a more complicated ActiveX control that does the same sort of thing, and this works fine as a release build running on an XP platform. However, when I move the ActiveX control to a Vista box, I get a crash in the Release build when trying to call setTextureAttributeAndModes on the stateset object of the drawable for my 3D object.

In an attempt to identify what's happening, I've recompiled OSG (I should say OSG1.2, sorry) with a few protected: classifications removed so that I can look at the values a bit easier, and step into some code. Having done this, it looks like when the setAttribute function is eventually called from setTextureAttributeAndModes, as soon as it executes the line

itr->second.first = attribute;

the system dies a horrible death, taking down the web browser in which the activeX control is running. Looking at the call stack it seems to be occuring when trying to clean up the dereferencing of the previously assigned texture (this was assigned as part of the 3DS load operation).

I can't believe that its the OSG code as such as the standalone version runs fine, however I was wondering whether anyone else has had a similar issue, and if so, could you give any tips as to what might be going wrong?

Many thanks for any help.


More information about the osg-users mailing list