MCPcopy Index your code
hub / github.com/MapServer/MapServer / msOGRFileClose

Function msOGRFileClose

mapogr.cpp:1533–1567  ·  view source on GitHub ↗

* msOGRFileClose() **********************************************************************/

Source from the content-addressed store, hash-verified

1531 * msOGRFileClose()
1532 **********************************************************************/
1533static int msOGRFileClose(layerObj *layer, msOGRFileInfo *psInfo )
1534{
1535 if (!psInfo)
1536 return MS_SUCCESS;
1537
1538 if( layer->debug )
1539 msDebug("msOGRFileClose(%s,%d).\n",
1540 psInfo->pszFname, psInfo->nLayerIndex);
1541
1542 CPLFree(psInfo->pszFname);
1543
1544 ACQUIRE_OGR_LOCK;
1545 if (psInfo->hLastFeature)
1546 OGR_F_Destroy( psInfo->hLastFeature );
1547
1548 /* If nLayerIndex == -1 then the layer is an SQL result ... free it */
1549 if( psInfo->nLayerIndex == -1 )
1550 OGR_DS_ReleaseResultSet( psInfo->hDS, psInfo->hLayer );
1551
1552 // Release (potentially close) the datasource connection.
1553 // Make sure we aren't holding the lock when the callback may need it.
1554 RELEASE_OGR_LOCK;
1555 msConnPoolRelease( layer, psInfo->hDS );
1556 ACQUIRE_OGR_LOCK;
1557
1558 // Free current tile if there is one.
1559 if( psInfo->poCurTile != NULL )
1560 msOGRFileClose( layer, psInfo->poCurTile );
1561
1562 CPLFree(psInfo);
1563
1564 RELEASE_OGR_LOCK;
1565
1566 return MS_SUCCESS;
1567}
1568
1569/**********************************************************************
1570 * msOGRFileWhichShapes()

Callers 3

msOGRFileReadTileFunction · 0.85
msOGRLayerOpenFunction · 0.85
msOGRLayerCloseFunction · 0.85

Calls 2

msDebugFunction · 0.85
msConnPoolReleaseFunction · 0.85

Tested by

no test coverage detected