From a0771630b04494f0a8cfb6d1a7b4a0a6458d2659 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Mon, 9 Sep 2013 10:57:45 +0400 Subject: [PATCH] restored original behaviour or release functions for (Buffer and Texture) --- modules/core/doc/opengl_interop.rst | 4 ++++ modules/core/src/opengl.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/modules/core/doc/opengl_interop.rst b/modules/core/doc/opengl_interop.rst index 53c58fcdf7..5267c4d451 100644 --- a/modules/core/doc/opengl_interop.rst +++ b/modules/core/doc/opengl_interop.rst @@ -122,6 +122,8 @@ Decrements the reference counter and destroys the buffer object if needed. .. ocv:function:: void ogl::Buffer::release() +The function will call `setAutoRelease(true)` . + ogl::Buffer::setAutoRelease @@ -323,6 +325,8 @@ Decrements the reference counter and destroys the texture object if needed. .. ocv:function:: void ogl::Texture2D::release() +The function will call `setAutoRelease(true)` . + ogl::Texture2D::setAutoRelease diff --git a/modules/core/src/opengl.cpp b/modules/core/src/opengl.cpp index 7bff69bf62..36a437a2d6 100644 --- a/modules/core/src/opengl.cpp +++ b/modules/core/src/opengl.cpp @@ -563,6 +563,8 @@ void cv::ogl::Buffer::create(int arows, int acols, int atype, Target target, boo void cv::ogl::Buffer::release() { #ifdef HAVE_OPENGL + if (impl_) + impl_->setAutoRelease(true); impl_ = Impl::empty(); rows_ = 0; cols_ = 0; @@ -1081,6 +1083,8 @@ void cv::ogl::Texture2D::create(int arows, int acols, Format aformat, bool autoR void cv::ogl::Texture2D::release() { #ifdef HAVE_OPENGL + if (impl_) + impl_->setAutoRelease(true); impl_ = Impl::empty(); rows_ = 0; cols_ = 0;