[gdal-dev] FlushCache and SyncToDisk

Frank Warmerdam warmerdam at pobox.com
Mon Mar 24 13:11:00 EDT 2008


Ari Jolma wrote:
> Frank,
> 
> I may have wondered and asked this before but anyway. Why don't the 
> dataset and layer destructors check, if they were opened as update and 
> call FlushCache or SyncToDisk in the destructor?
> 
> I thought about adding this into the wrappers but eAccess is a protected 
> member of GDALDataset for example.

Ari,

All driver implementations are supposed to flush to disk when the
datasource/dataset is destroyed.  If they don't, it is a bug in the
driver implementation and should (IMHO) be addressed there.

A problem I think we have had sometimes in the swig bindings is
that confusion about reference counting has resulted in the
datasource/dataset objects not being properly destroyed.  But I
think we also need to solve the root of this problem (if it still
exists), not work around the symptoms.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the gdal-dev mailing list