1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 07:13:02 +04:00

fix memory leak in viz3d

This commit is contained in:
ozantonkal
2013-08-29 19:06:12 +02:00
committed by Ozan Tonkal
parent 6c0c217562
commit 69f135ec57
+3 -1
View File
@@ -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());