Menu

#4 Memory leaks in CyberX3D C++ : cx3dcc101.tar.gz

open
nobody
None
5
2004-07-22
2004-07-22
rzr
No

Memory leaks in CyberX3D C++ : cx3dcc101.tar.gz @
http://cx3dcc.sourceforge.net

I am afraid CyberX3D Vrml parser has a few mem leaks
I valgrinded a simple program, here follow the report
If it helps
(But there are other ones, I can send u a full report
if needed,
but using valgrind is best, isnt it? )

Also There is a missing feature that I will need soon,
@
https://sourceforge.net/tracker/?group_id=68684&atid=522055
Is it possible to open buffer memory or even better C++
istream* ?
I have read that GNU flex does C++ bindings

Are there new version of cx3dcc planed ? if no i may
provide a patch

####

SceneGraph *sceneGraph = new SceneGraph();
bool lodingResult = sceneGraph->load(argv[1], false);

if (lodingResult == true) {
sceneGraph->printXML();
}
####

==21921== 17 bytes in 9 blocks are definitely lost in
loss record 15 of 21
==21921== at 0x34147959: operator new[](unsigned)
(vg_replace_malloc.c:139)
==21921== by 0x805F802:
CyberX3D::Node::getIndentLevelString(int) (Node.cpp:1046)
==21921== by 0x805FD2F:
CyberX3D::Node::outputXMLField(std::ostream&,
CyberX3D::Field*, int, bool) (Node.cpp:1156)
==21921== by 0x80601BA:
CyberX3D::Node::outputXML(std::ostream&, int)
(Node.cpp:1256)
==21921==
==21921==
==21921== 92 bytes in 8 blocks are definitely lost in
loss record 18 of 21
==21921== at 0x34147959: operator new[](unsigned)
(vg_replace_malloc.c:139)
==21921== by 0x805F842:
CyberX3D::Node::getSpaceString(int) (Node.cpp:1054)
==21921== by 0x805FD53:
CyberX3D::Node::outputXMLField(std::ostream&,
CyberX3D::Field*, int, bool) (Node.cpp:1158)
==21921== by 0x80601BA:
CyberX3D::Node::outputXML(std::ostream&, int)
(Node.cpp:1256)
==21921==
==21921== LEAK SUMMARY:
==21921== definitely lost: 109 bytes in 17 blocks.

####

# Env
HOSTYPE=i586
MACHTYPE=i586-mandrake-linux-gnu
OSTYPE=linux-gnu

Mandrake Linux release 9.2 (FiveStar) for i586

# Tools
gcc (GCC) 3.3.1 (Mandrake Linux 9.2 3.3.1-2mdk)
GNU Make 3.80
Autoconf version 2.13
automake (GNU automake) 1.4-p6
valgrind-2.1.2

Discussion