Skip to content
Snippets Groups Projects
Commit eceff0fc authored by Andre Sailer's avatar Andre Sailer
Browse files

Segmentation: setDecoder

* protect against self assignment
* delete NULL is a no-op, don't need to check
parent aeb9ffef
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
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