* msOGRFileClose() **********************************************************************/
| 1531 | * msOGRFileClose() |
| 1532 | **********************************************************************/ |
| 1533 | static 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() |
no test coverage detected