fix memory leak in viz3d
This commit is contained in:
parent
6c0c217562
commit
69f135ec57
@ -33,7 +33,9 @@ void cv::viz::Viz3d::create(const String &window_name)
|
|||||||
|
|
||||||
void cv::viz::Viz3d::release()
|
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
|
// Erase the window
|
||||||
cv::viz::VizAccessor::getInstance().remove(getWindowName());
|
cv::viz::VizAccessor::getInstance().remove(getWindowName());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user