Commit b102bc66 authored by Alexey Ershov's avatar Alexey Ershov

fixed memory leaks

parent 47e7a7a7
...@@ -223,9 +223,9 @@ public: ...@@ -223,9 +223,9 @@ public:
cv::cvtColor(m_frame_bgr, m_frame_rgba, CV_RGB2RGBA); cv::cvtColor(m_frame_bgr, m_frame_rgba, CV_RGB2RGBA);
if (use_buffer()) if (use_buffer())
buffer.copyFrom(m_frame_rgba); buffer.copyFrom(m_frame_rgba, cv::ogl::Buffer::PIXEL_UNPACK_BUFFER, true);
else else
texture.copyFrom(m_frame_rgba); texture.copyFrom(m_frame_rgba, true);
return 0; return 0;
} }
...@@ -287,6 +287,9 @@ public: ...@@ -287,6 +287,9 @@ public:
cv::ogl::Texture2D texture; cv::ogl::Texture2D texture;
cv::ogl::Buffer buffer; cv::ogl::Buffer buffer;
texture.setAutoRelease(true);
buffer.setAutoRelease(true);
r = get_frame(texture, buffer); r = get_frame(texture, buffer);
if (r != 0) if (r != 0)
{ {
...@@ -317,9 +320,9 @@ public: ...@@ -317,9 +320,9 @@ public:
} }
if (do_buffer) if (do_buffer)
buffer.copyFrom(m); buffer.copyFrom(m, cv::ogl::Buffer::PIXEL_UNPACK_BUFFER, true);
else else
texture.copyFrom(m); texture.copyFrom(m, true);
break; break;
} }
...@@ -354,7 +357,7 @@ public: ...@@ -354,7 +357,7 @@ public:
{ {
cv::Mat m(m_height, m_width, CV_8UC4); cv::Mat m(m_height, m_width, CV_8UC4);
buffer.copyTo(m); buffer.copyTo(m);
texture.copyFrom(m); texture.copyFrom(m, true);
} }
#if defined(__linux__) #if defined(__linux__)
......
...@@ -162,9 +162,9 @@ public: ...@@ -162,9 +162,9 @@ public:
idle(); idle();
} }
} while (!m_end_loop); } while (!m_end_loop);
#endif
return 0; return 0;
#endif
} }
protected: protected:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment