Skip to content

Commit

Permalink
fixed segfault on exit if path does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
normanb committed Apr 11, 2019
1 parent b1f01a4 commit b7b8d3b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions gdal/frmts/tiledb/tiledbdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ TileDBDataset::~TileDBDataset()
static_cast<TileDBRasterBand*>( poBand )->Finalize();
}
}

m_array->close();
if ( m_array )
m_array->close();
CPLDestroyXMLNode( psSubDatasetsTree );
CSLDestroy( papszSubDatasets );
}
Expand Down Expand Up @@ -601,7 +601,7 @@ CPLErr TileDBDataset::TrySaveXML()
}
catch(const tiledb::TileDBError e)
{
CPLError( CE_Failure, CPLE_AppDefined, "TileDB: %s\n", e.what() );
CPLError( CE_Failure, CPLE_AppDefined, "%s\n", e.what() );
return CE_Failure;
}
}
Expand Down Expand Up @@ -716,7 +716,7 @@ CPLErr TileDBDataset::TryLoadXML( char ** /*papszSiblingFiles*/ )
}
catch(const tiledb::TileDBError e)
{
CPLError( CE_Failure, CPLE_AppDefined, "TileDB: %s\n", e.what() );
CPLError( CE_Failure, CPLE_AppDefined, "%s\n", e.what() );
return CE_Failure;
}
}
Expand Down Expand Up @@ -803,7 +803,7 @@ CPLErr TileDBDataset::AddFilter( const char* pszFilterName, const int level )
}
catch(const tiledb::TileDBError e)
{
CPLError( CE_Failure, CPLE_AppDefined, "TileDB: %s\n", e.what() );
CPLError( CE_Failure, CPLE_AppDefined, "%s\n", e.what() );
return CE_Failure;
}
}
Expand All @@ -829,7 +829,7 @@ CPLErr TileDBDataset::Delete( const char * pszFilename )
}
catch(const tiledb::TileDBError e)
{
CPLError( CE_Failure, CPLE_AppDefined, "TileDB: %s\n", e.what() );
CPLError( CE_Failure, CPLE_AppDefined, "%s\n", e.what() );
return CE_Failure;
}
}
Expand Down Expand Up @@ -1096,7 +1096,7 @@ GDALDataset *TileDBDataset::Open( GDALOpenInfo * poOpenInfo )
}
catch(const tiledb::TileDBError e)
{
CPLError( CE_Failure, CPLE_AppDefined, "TileDB: %s\n", e.what() );
CPLError( CE_Failure, CPLE_AppDefined, "%s\n", e.what() );
return nullptr;
}
}
Expand Down Expand Up @@ -1288,7 +1288,7 @@ CPLErr TileDBDataset::CreateAttribute( GDALDataType eType,
}
catch(const tiledb::TileDBError e)
{
CPLError( CE_Failure, CPLE_AppDefined, "TileDB: %s\n", e.what() );
CPLError( CE_Failure, CPLE_AppDefined, "%s\n", e.what() );
return CE_Failure;
}
}
Expand Down Expand Up @@ -1425,7 +1425,7 @@ TileDBDataset* TileDBDataset::CreateLL( const char *pszFilename,
}
catch(const tiledb::TileDBError e)
{
CPLError( CE_Failure, CPLE_AppDefined, "TileDB: %s\n", e.what() );
CPLError( CE_Failure, CPLE_AppDefined, "%s\n", e.what() );
return nullptr;
}
}
Expand Down Expand Up @@ -1624,7 +1624,7 @@ CPLErr TileDBDataset::CopySubDatasets( GDALDataset* poSrcDS,
}
catch(const tiledb::TileDBError e)
{
CPLError( CE_Failure, CPLE_AppDefined, "TileDB: %s\n", e.what() );
CPLError( CE_Failure, CPLE_AppDefined, "%s\n", e.what() );
return CE_Failure;
}
}
Expand Down Expand Up @@ -1672,7 +1672,7 @@ TileDBDataset::Create( const char * pszFilename, int nXSize, int nYSize, int nBa
}
catch(const tiledb::TileDBError e)
{
CPLError( CE_Failure, CPLE_AppDefined, "TileDB: %s\n", e.what() );
CPLError( CE_Failure, CPLE_AppDefined, "%s\n", e.what() );
return nullptr;
}
}
Expand Down Expand Up @@ -1822,7 +1822,7 @@ TileDBDataset::CreateCopy( const char * pszFilename, GDALDataset *poSrcDS,
}
catch(const tiledb::TileDBError e)
{
CPLError( CE_Failure, CPLE_AppDefined, "TileDB: %s\n", e.what() );
CPLError( CE_Failure, CPLE_AppDefined, "%s\n", e.what() );
return nullptr;
}
}
Expand Down

0 comments on commit b7b8d3b

Please sign in to comment.