Skip to content
Snippets Groups Projects
Commit 3726a2fc authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

Merge branch '1504-sampleextraction-application-memory-usage-grows-constantly' into 'develop'

Resolve "SampleExtraction application memory usage grows constantly"

Closes #1504

See merge request !6
parents 1e390f12 4b3cb3f7
No related branches found
No related tags found
1 merge request!6Resolve "SampleExtraction application memory usage grows constantly"
......@@ -265,6 +265,11 @@ PersistentSamplingFilterBase<TInputImage,TMaskImage>
}
this->m_InMemoryOutputs.push_back(tmpContainer);
}
if (oSRS)
{
oSRS->Release();
}
}
template <class TInputImage, class TMaskImage>
......@@ -734,7 +739,7 @@ PersistentSamplingFilterBase<TInputImage,TMaskImage>
}
const unsigned int nbFeatThread = std::ceil(inLayer.GetFeatureCount(true) / (float) numberOfThreads);
assert(nbFeatThread > 0);
//assert(nbFeatThread > 0);
OGRFeatureDefn &layerDefn = inLayer.GetLayerDefn();
ogr::Layer::const_iterator featIt = inLayer.begin();
......@@ -807,6 +812,11 @@ PersistentSamplingFilterBase<TInputImage,TMaskImage>
OGRFieldDefn fieldDefn(layerDefn.GetFieldDefn(k));
outLayer.CreateField(fieldDefn);
}
if (oSRS)
{
oSRS->Release();
}
}
// Add new fields
......
......@@ -129,6 +129,7 @@ int otbImageSampleExtractorFilterUpdate(int argc, char* argv[])
output->CreateLayer( inLayer.GetName(),
oSRS,
inLayer.GetLayerDefn().GetGeomType());
oSRS->Release();
otb::ogr::Layer dstLayer = output->GetLayer(0);
OGRFieldDefn labelField(classFieldName.c_str(),OFTString);
dstLayer.CreateField(labelField, true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment