deallocate is only called if the number of curves is not 0

This commit is contained in:
Sébastien Loriot 2015-10-07 17:01:55 +02:00
parent 62644a62aa
commit 1fa107c8c4
1 changed files with 3 additions and 2 deletions

View File

@ -115,8 +115,9 @@ public:
this->m_visitor->before_sweep();
// Allocate all of the Subcurve objects as one block.
this->m_num_of_subCurves = static_cast<unsigned int>(std::distance (curves_begin, curves_end));
this->m_subCurves =
this->m_subCurveAlloc.allocate (this->m_num_of_subCurves);
if (this->m_num_of_subCurves > 0)
this->m_subCurves =
this->m_subCurveAlloc.allocate (this->m_num_of_subCurves);
this->m_curves_pair_set.resize (2 * this->m_num_of_subCurves);