Problem with VrmlData_ListOfNode::Iterator


I am iterating over a list of nodes of a VrmlData_Group. the iterator crashes after the last element in the next-function of the iterator (Access Violation). The problem appeared first when I made an update to OCC 7.4.0. In my previous version, OCC 7.1.0 the same code worked fine.
Here is my code:

const Handle(VrmlData_Group)& aGroupNode = Handle(VrmlData_Group)::DownCast(aNode);
 if (!aGroupNode.IsNull())
           VrmlData_ListOfNode::Iterator iter = aGroupNode->NodeIterator();
          for (; iter.More(); iter.Next())
                Handle(VrmlData_Node)& testnode = iter.Value();


What am I doing wrong? As I said, everthing worked fine before the update

Kind regards,

Kirill Gavrilov's picture

I have some doubts that just using an iterator may cause such problem - most likely it happens somewhere else.
Does it happen with any VRML model or with specific one (which could be used for reproducing)?

const Handle(VrmlData_Group)& aGroupNode = Handle(VrmlData_Group)::DownCast(aNode);

Note that DownCast returns not a reference to casted object but a copy Handle(VrmlData_Group).

Joachim Greiner's picture

The problem is finally solved. After a lot try and error, I figured out that there was a problem with tcl86.dll. I downloaded the latest version an compiled it for VS 2015 32 Bit. After that, everything works fine. Before I used the 32 bit Version from the OCC website, but this one didn't  work right together with VS 2015.