dreamstreat / libkml

Automatically exported from code.google.com/p/libkml
Other
0 stars 0 forks source link

Memory Leak, SWIG does not produce destructor for some elements #91

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

import kmldom
val = '<Polygon></Polygon>'
element = kmldom.ParseKml(val)
TypeDict =
{kmldom.Type_Metadata:kmldom.AsMetadata(element),kmldom.Type_XalAddressDetails:k
mldom.AsXalAddressDetails(element),kmldom.Type_XalAdministrativeArea:kmldom.AsXa
lAdministrativeArea(element),kmldom.Type_XalCountry:kmldom.AsXalCountry(element)
,kmldom.Type_XalLocality:kmldom.AsXalLocality(element),kmldom.Type_XalPostalCode
:kmldom.AsXalPostalCode(element),kmldom.Type_XalSubAdministrativeArea:kmldom.AsX
alSubAdministrativeArea(element),kmldom.Type_XalThoroughfare:kmldom.AsXalThoroug
hfare(element),
}
TypeDict[kmldom.Element.Type(element)]
TypeDict =
{kmldom.Type_Metadata:kmldom.AsMetadata(element),kmldom.Type_XalAddressDetails:k
mldom.AsXalAddressDetails(element),kmldom.Type_XalAdministrativeArea:kmldom.AsXa
lAdministrativeArea(element),kmldom.Type_XalCountry:kmldom.AsXalCountry(element)
,kmldom.Type_XalLocality:kmldom.AsXalLocality(element),kmldom.Type_XalPostalCode
:kmldom.AsXalPostalCode(element),kmldom.Type_XalSubAdministrativeArea:kmldom.AsX
alSubAdministrativeArea(element),kmldom.Type_XalThoroughfare:kmldom.AsXalThoroug
hfare(element),
}

What is the expected output? What do you see instead?

Expected: Nothing
Got: 
swig/python detected a memory leak of type 'boost::intrusive_ptr<
kmldom::XalAdministrativeArea > *', no destructor found.
swig/python detected a memory leak of type 'boost::intrusive_ptr<
kmldom::XalAddressDetails > *', no destructor found.
swig/python detected a memory leak of type 'boost::intrusive_ptr<
kmldom::Metadata > *', no destructor found.
swig/python detected a memory leak of type 'kmldom::XalCountryPtr *', no
destructor found.
swig/python detected a memory leak of type 'kmldom::XalLocalityPtr *', no
destructor found.
swig/python detected a memory leak of type 'kmldom::XalPostalCodePtr *', no
destructor found.
swig/python detected a memory leak of type
'kmldom::XalSubAdministrativeAreaPtr *', no destructor found.
swig/python detected a memory leak of type 'kmldom::XalThoroughfarePtr *',
no destructor found.

Please use labels and text to provide additional information.

Programming in Python 2.6
Ubuntu 9.04
libkml 1.o

This is not a high priority because these elements have all been phased
out, but I ran into this error trying to make a dictionary of all of the
elements. Thought it would be good to pass this along. Thanks!

Original issue reported on code.google.com by ronald.k...@gmail.com on 4 Jun 2009 at 2:19