<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>---------- 转发邮件信息 ----------<BR>发件人:"chenxuexia <xuex_chen@126.com>" <BR>发送日期:2007-09-17 14:04:46<BR>收件人:"Frank Warmerdam" <warmerdam@pobox.com><BR>主题: OGR_sde questions<BR>
<DIV>hi, All.</DIV>
<DIV> I tried to use the following code to read a sde configured database,but even i hadn't done anything with the OGRDataSource pointer, it terminated with MEMORY LEAK. It seems each Layer pointer is still not been deleted. Should we delete some SdeDS's members before call DestroyDataSource() method ? </DIV>
<DIV>///////////////////////////////////////////////////////////</DIV>
<DIV>BOOL cls_sdeVector::OpenSDE(const char* szFileName)</DIV>
<DIV>{</DIV>
<DIV> RegisterOGRSDE();<BR> OGRDataSource *SdeDS;</DIV>
<DIV> SdeDS = OGRSFDriverRegistrar::Open( szFileName, FALSE );<BR> if( SdeDS == NULL )<BR> {<BR> AfxMessageBox("Open SDE database failed.");<BR> exit(1);<BR> }<BR> nLayer = SdeDS->GetLayerCount();<BR> OGRDataSource::DestroyDataSource( SdeDS );//memory leak !<BR> return TRUE;</DIV>
<DIV>}</DIV>
<DIV>/////////////////////////////////////////////////////////</DIV>
<P>The memory leak information is below (there's TOW feature layer in the database):<BR><!-- footer --></P>
<P>-------------------------------------</P>
<P>Detected memory leaks!<BR>Dumping objects -><BR>{477} normal block at 0x010A9ED0, 33 bytes long.<BR> Data: < SHAPE > 00 53 48 41 50 45 00 CD CD CD CD CD CD CD CD CD <BR>{476} normal block at 0x010A9FB8, 16 bytes long.<BR> Data: < > 02 00 00 00 02 00 00 00 04 00 00 00 04 00 00 00 <BR>{475} normal block at 0x010A9F60, 16 bytes long.<BR> Data: < > 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 <BR>{470} normal block at 0x010A9C58, 24 bytes long.<BR> Data: < : 0 > CC E7 3A 10 01 00 00 00 04 00 00 00 30 80 AD 01 <BR>{469} normal block at 0x010A9DC8, 192 bytes long.<BR> Data: < < > B8 12 3C 00 CD CD CD CD 00 00 00 00 00 00 00 00 <BR>{468} normal block at 0x010A9BF0, 33 bytes long.<BR> Data: < SHAPE > 00 53 48 41 50 45 00 CD CD CD CD CD CD CD CD CD <BR>{467} normal block at 0x010A9CB0, 64 bytes long.<BR> Data: < > 02 00 00 00 04 00 00 00 04 00 00 00 02 00 00 00 <BR>{466} normal block at 0x010A9D40, 64 bytes long.<BR> Data: < > 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 <BR>{457} normal block at 0x010A9930, 24 bytes long.<BR> Data: < : z > CC E7 3A 10 01 00 00 00 0A 00 00 00 B0 7A AD 01 <BR>{456} normal block at 0x010A9AE8, 192 bytes long.<BR> Data: < < > B8 12 3C 00 CD CD CD CD 00 00 00 00 00 00 00 00 <BR>{455} normal block at 0x010A9A80, 33 bytes long.<BR></P>
<P>It seems each layer results in memory leak. I'm sorry i can't locate the error. Could anyone give me some advices?
<HR>
</P>
<P><A style="FONT-SIZE: 14px; COLOR: #000; LINE-HEIGHT: 15px; TEXT-DECORATION: none" href="http://event.mail.163.com/chanel/click.htm?from=NO_20&domain=126" target=_blank><SPAN style="COLOR: blue; TEXT-DECORATION: underline">点 击 此 处!免 费 试 玩 07 年 最 受 期 待 的 游 戏 大 作 !</SPAN> </A></P>