Access Violation on Manager->Destroy() becuase I get material index array
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So a the end of my program, I call Manager->Destroy() for cleanup. This code works fine and gives me no problems until I added new code to get the index array of associated with material mapping.
This is the line where I get the element material to eventually get the index array. As far as I can tell, this is not the problem line
FbxGeometryElementMaterial* geoElement = mesh->GetElementMaterial();
After getting geoElement, I check the mapping mode. Again, this is not the problem code, so I'm not going to include.
After getting the mapping mode, I get the index array from geo element for information about how the variety of materials is mapped to the mesh with the following code. This is the problematic code, as including this code is what causes my program to get an access violation on cleanup. If i comment out this code, there is no access violation
FbxLayerElementArray indArray = geoElement->GetIndexArray(); int mapIndex; for (int i = 0; i < indArray.GetCount(); ++i) { indArray.GetAt(i, &mapIndex); std::cout << "Map " << i << ": " << mapIndex << std::endl; }
In case it helps, the error occurs on :
manager->Destroy();
And the specific error message is:
Unhandled exception at 0x018BA7D1 in FbxConverter.exe: 0xC0000005: Access violation reading location 0xFEEEFEF6.
Any help with this issue would be appreciated.