[gdal-dev] Regarding to the memory management in the SWIG API

Tamas Szekeres szekerest at gmail.com
Wed Jan 8 02:10:58 PST 2014


Hi Devs,

Is that intentional that we don't call ReleaseResultset within the
destructor of the OGR Layer object? Actually the destructor is not even
generated (at least for the C# API) which seems to be an improper solution
and leads to memory leaks, definitely. However ReleaseResultset is exposed
in the API, but it's fairly dangerous to let the user decide whether to
call this method or not.

In my understanding the destructor of the Layer object should look
something like the destructor of the DataSource (but calling
ReleaseResultset instead of ReleaseDatasource). However modifying the code
this way, may lead to a crash for the existing code which call
ReleaseResultset directly.

Any opinion?

Best regards,

Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140108/c9525c4f/attachment.html>


More information about the gdal-dev mailing list