Hi Tobias,
if your code compiles, then _textures is a multi field of
NodePtr, not a multi field of textures.
for(MFNodePtr::iterator i=_textures.begin();i!=_textures.end();i++)
^^^^^^^^^
So it's not surprising that you get problems when you cast *i
to a TextureChunkPtr.
Best regards,
Hagen
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Tobias
Berghoff
Sent: Montag, 28. Juni 2004 20:49
To: [email protected]
Subject: [Opensg-users] Segfault at endEditCP
Hallo!
Probably a serious braino, but anyway:
I've changed part of the VRML loader and get a segmentation fault when
calling endEditCP.
The Code looks like this:
_textures contains one texture at this point, btw.
std::cerr<<"setting textures\n";
beginEditCP(pChunkMat, ChunkMaterial::ChunksFieldMask);
{
for(MFNodePtr::iterator i=_textures.begin();i!=_textures.end();i++)
{
std::cerr<<"trying...\n";
TextureChunkPtr pTexture = TextureChunkPtr::dcast(*i);
pChunkMat->addChunk(pTexture);
std::cerr<<"added texture\n";
}
}
std::cerr<<"before endEditCP "<<pChunkMat<<"\n";
endEditCP(pChunkMat, ChunkMaterial::ChunksFieldMask);
std::cerr<<"textures done\n";
Which generates this output:
setting textures FCPtr 0x0xbfffe840:ChunkMaterialPtr(0x0x8163eb0)
trying...
added texture
before endEditCP FCPtr 0x0xbfffe840:ChunkMaterialPtr(0x0x8163eb0)
Speicherzugriffsfehler (aka segfault)
Any quick idea, or do I have to work myself through the code of endEditCP?
:)
Tobias
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users