fix memory leak in viz3d

pull/1453/head
ozantonkal 12 years ago committed by Ozan Tonkal
parent 6c0c217562
commit 69f135ec57
  1. 4
      modules/viz/src/viz3d.cpp

@ -33,7 +33,9 @@ void cv::viz::Viz3d::create(const String &window_name)
void cv::viz::Viz3d::release()
{
if (impl_ && CV_XADD(&impl_->ref_counter, -1) == 1)
// If the current referene count is equal to 2, we can delete it
// - 2 : because minimum there will be two instances, one of which is in the map
if (impl_ && CV_XADD(&impl_->ref_counter, -1) == 2)
{
// Erase the window
cv::viz::VizAccessor::getInstance().remove(getWindowName());

Loading…
Cancel
Save