Fix an issue when updating the reference image

This commit is contained in:
Emmanuel Papin 2014-11-19 10:50:41 +01:00
parent fab48b904f
commit 166b4586aa
1 changed files with 6 additions and 4 deletions

View File

@ -280,6 +280,12 @@ bool Zone::CheckAlarms( const Image *comp_image )
return( false );
}
if ( reinit_nat_det )
{
Debug( 4, "Update reference image of zone %s", label );
ref_image = *comp_image;
}
delete image;
// Get the difference image
Image *diff_image = image = new Image( delta_image );
@ -880,10 +886,6 @@ bool Zone::CheckAlarms( const Image *comp_image )
score = 0;
image = new Image( bl_image );
}
// Update reference image if required
if ( reinit_nat_det ) {
ref_image = *comp_image;
}
// Only need to delete this when 'image' becomes detached and points somewhere else
delete diff_image;
}