Skip to content

Commit

Permalink
Merge pull request OSGeo#11448 from rouault/fix_11447
Browse files Browse the repository at this point in the history
GDALRasterBlock: make sure mutex is initialize in repeated calls to GDALAllRegister / GDALDestroyDriverManager
  • Loading branch information
rouault authored Dec 6, 2024
2 parents 383b6e4 + 48aa1a2 commit 4557673
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gcore/gdalrasterblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,13 @@ GDALRasterBlock::GDALRasterBlock(GDALRasterBand *poBandIn, int nXOffIn,
nXOff(nXOffIn), nYOff(nYOffIn), nXSize(0), nYSize(0), pData(nullptr),
poBand(poBandIn), poNext(nullptr), poPrevious(nullptr), bMustDetach(true)
{
if (!hRBLock)
{
// Needed for scenarios where GDALAllRegister() is called after
// GDALDestroyDriverManager()
INITIALIZE_LOCK;
}

CPLAssert(poBandIn != nullptr);
poBand->GetBlockSize(&nXSize, &nYSize);
}
Expand Down

0 comments on commit 4557673

Please sign in to comment.