Skip to content

Commit

Permalink
Remove unnecessary FlushCache calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Gillies committed May 16, 2017
1 parent 127c40c commit d8b9e01
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 0 additions & 1 deletion rasterio/_base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ cdef class DatasetBase(object):
def stop(self):
"""Ends the dataset's life cycle"""
if self._hds != NULL:
GDALFlushCache(self._hds)
GDALClose(self._hds)
self._hds = NULL
log.debug("Dataset %r has been stopped.", self)
Expand Down
10 changes: 9 additions & 1 deletion rasterio/_io.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ cdef class DatasetReaderBase(DatasetBase):
cdef GDALDatasetH dataset = NULL

dataset = self.handle()
GDALFlushCache(dataset)

# Prepare the IO window.
if window:
Expand Down Expand Up @@ -1048,6 +1047,15 @@ cdef class DatasetWriterBase(DatasetReaderBase):
self.update_tags(ns='rio_creation_kwds', **kwds)
self._closed = False

def stop(self):
"""Ends the dataset's life cycle"""
if self._hds != NULL:
GDALFlushCache(self._hds)
GDALClose(self._hds)
self._hds = NULL
self._closed = True
log.debug("Dataset %r has been stopped.", self)

def set_crs(self, crs):
"""Writes a coordinate reference system to the dataset."""
cdef char *proj_c = NULL
Expand Down
3 changes: 0 additions & 3 deletions rasterio/_warp.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,5 @@ cdef class WarpedVRTReaderBase(DatasetReaderBase):
def stop(self):
"""Ends the VRT's life cycle"""
if self._hds != NULL:
GDALFlushCache(self._hds)
GDALClose(self._hds)
self._hds = NULL


0 comments on commit d8b9e01

Please sign in to comment.