Skip to content

Commit

Permalink
msOGRWriteFromQuery(): use OSRRelease() instead of OSRDestroySpatialR…
Browse files Browse the repository at this point in the history
…eference()

The CreateLayer() implementation of some OGR drivers might potentially only
increase the reference counter on the passed SRS instead of doing a full clone.
Consequently using OSRDestroySpatialReference() is not appropriate, as it will
destroy the SRS even if it is referenced by the OGR layer.
  • Loading branch information
rouault committed Mar 4, 2016
1 parent fb73a05 commit 40c8ffd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mapogroutput.c
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ int msOGRWriteFromQuery( mapObj *map, outputFormatObj *format, int sendheaders )
}

if( srs != NULL )
OSRDestroySpatialReference( srs );
OSRRelease( srs );

/* -------------------------------------------------------------------- */
/* Create appropriate attributes on this layer. */
Expand Down

0 comments on commit 40c8ffd

Please sign in to comment.