Permalink
Browse files

msOGRWriteFromQuery(): use OSRRelease() instead of OSRDestroySpatialR…

…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 40c8ffddb0a6c9defa05bcf13dd25767c9c8db8b
Showing with 1 addition and 1 deletion.
  1. +1 −1 mapogroutput.c
View
@@ -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. */

0 comments on commit 40c8ffd

Please sign in to comment.