diff --git a/DDSegmentation/src/Segmentation.cpp b/DDSegmentation/src/Segmentation.cpp index b284acc568d075b654e855ee1e86024948b0c057..6f3dbf6f5d42f864b5dc3f6fa2166d7abfa8f231 100644 --- a/DDSegmentation/src/Segmentation.cpp +++ b/DDSegmentation/src/Segmentation.cpp @@ -86,7 +86,8 @@ void Segmentation::neighbours(const CellID& cID, std::set<CellID>& cellNeighbour /// Set the underlying decoder void Segmentation::setDecoder(BitField64* newDecoder) { - if (_ownsDecoder and _decoder != 0) { + if ( _decoder == newDecoder ) return; //self assignment + if (_ownsDecoder) { delete _decoder; } _decoder = newDecoder;