From: Xiang Y. <xy...@pr...> - 2003-04-10 17:40:36
|
Hello, I got following message with --leak-check=3Dyes, valgrind 1.0.4. =3D=3D1750=3D=3D 1825 bytes in 146 blocks are definitely lost in loss = record 98 o =3D=3D1750=3D=3D at 0x400485EC: __builtin_vec_new = (vg_clientfuncs.c:156) =3D=3D1750=3D=3D by 0x8061119: idgapis::prepareparams(void) = (idgapis.cpp:904) =3D=3D1750=3D=3D by 0x806199E: idgapis::proc(void) (idgapis.cpp:1052) =3D=3D1750=3D=3D by 0x8063ED7: idgsockthread::callapi(void) = (idgsockthread.cpp My question is, for code below, valgrind will report an error or not on = memory allocated for c1::m_p1? class c1 { ~c1()=20 { delete []m_p1; } void * m_p1; } class c2 { ~c2() { if(m_c1 !=3D NULL) delete []m_c1; } func1() { m_c1 =3D new c1[10]; for(i =3D 0; i < 10; i++) { m_c1[i].m_p1 =3D new char[10]; } }=20 c1 *m_c1; } somewhere else outside above class has following call: c2 *pc2 =3D new c2(); c2->func1(); delete c2; TIA Xiang |