[Gdal-dev] Fw:OGR_sde questions

chenxuexia xuex_chen at 126.com
Wed Sep 19 23:24:38 EDT 2007


    ---------- ת·¢ÓʼþÐÅÏ¢ ----------
·¢¼þÈË£º"chenxuexia <xuex_chen at 126.com>"
·¢ËÍÈÕÆÚ£º2007-09-17 14:04:46
ÊÕ¼þÈË£º"Frank Warmerdam" <warmerdam at pobox.com>
Ö÷Ì⣺ OGR_sde questions
hi, All.  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 ?  ///////////////////////////////////////////////////////////BOOL cls_sdeVector::OpenSDE(const char* szFileName){ RegisterOGRSDE();
 OGRDataSource       *SdeDS; SdeDS = OGRSFDriverRegistrar::Open( szFileName, FALSE );
 if( SdeDS == NULL )
 {
  AfxMessageBox("Open SDE database failed.");
  exit(1);
 }
  nLayer = SdeDS->GetLayerCount();
  OGRDataSource::DestroyDataSource( SdeDS );//memory leak !
 return TRUE;}/////////////////////////////////////////////////////////
The memory leak information is below (there's TOW feature layer in the database):
-------------------------------------
Detected memory leaks!
Dumping objects ->
{477} normal block at 0x010A9ED0, 33 bytes long.
 Data: < SHAPE          > 00 53 48 41 50 45 00 CD CD CD CD CD CD CD CD CD
{476} normal block at 0x010A9FB8, 16 bytes long.
 Data: <                > 02 00 00 00 02 00 00 00 04 00 00 00 04 00 00 00
{475} normal block at 0x010A9F60, 16 bytes long.
 Data: <                > 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00
{470} normal block at 0x010A9C58, 24 bytes long.
 Data: <  :         0   > CC E7 3A 10 01 00 00 00 04 00 00 00 30 80 AD 01
{469} normal block at 0x010A9DC8, 192 bytes long.
 Data: <  <             > B8 12 3C 00 CD CD CD CD 00 00 00 00 00 00 00 00
{468} normal block at 0x010A9BF0, 33 bytes long.
 Data: < SHAPE          > 00 53 48 41 50 45 00 CD CD CD CD CD CD CD CD CD
{467} normal block at 0x010A9CB0, 64 bytes long.
 Data: <                > 02 00 00 00 04 00 00 00 04 00 00 00 02 00 00 00
{466} normal block at 0x010A9D40, 64 bytes long.
 Data: <                > 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00
{457} normal block at 0x010A9930, 24 bytes long.
 Data: <  :          z  > CC E7 3A 10 01 00 00 00 0A 00 00 00 B0 7A AD 01
{456} normal block at 0x010A9AE8, 192 bytes long.
 Data: <  <             > B8 12 3C 00 CD CD CD CD 00 00 00 00 00 00 00 00
{455} normal block at 0x010A9A80, 33 bytes long.
It seems each layer results in memory leak. I'm sorry i can't locate the error. Could anyone give me some advices?  
µã »÷ ´Ë ´¦£¡Ãâ ·Ñ ÊÔ Íæ 07 Äê ×î ÊÜ ÆÚ ´ý µÄ ÓÎ Ï· ´ó ×÷ £¡
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070920/ad73da74/attachment.html


More information about the Gdal-dev mailing list