创建本地opencv mat对象时内存泄漏
memory leak when creating local opencv mat object
我有一个函数,我做了一个mat操作。
void my_func()
{
vector<Point> my_vect=another_func();
Mat my_array((int)my_vect.size(),1,CV_8UC1); //This line is reported as leakage
for(int i=0;i<my_vect.size();i++)
my_array.at<uchar>(i,1)=Other_image.at<uchar>(my_vect[i]);
}
不知道泄漏,但至少有一个缓冲区溢出。
Mat my_array( 17, 1, CV_8UC1 ); // 17 rows, 1 col
for(int i=0; i<17; i++)
// should be (i,0) below, (i,1) is already out of bounds
my_array.at<uchar>(i,1) = Other_image.at<uchar>(my_vect[i]); // <-- this looks broken, too
相关文章:
- 从构造函数抛出异常时如何克服内存泄漏
- malloc() 可能出现内存泄漏
- 这个极客对极客的trie实现是否存在内存泄漏问题
- 尽管遵循了规则,内存泄漏在哪里
- 为什么调用堆栈数组会导致内存泄漏
- 在简单示例中,Python3 + ctypes 回调会导致内存泄漏
- 使用模板类的自定义列表类型中的内存泄漏
- 为什么以下C++代码中存在内存泄漏?
- OpenCV 我应该使用智能指针来防止内存泄漏吗?
- 我是否生成线程并导致内存泄漏?
- 多线程程序中出现意外的内存泄漏
- 为什么此函数会导致内存泄漏?
- 在 C++ 库中使用cythonized python时内存泄漏
- 需要帮助查找内存泄漏
- 瓦尔格林德的内存泄漏使用新的
- 无法找出我的代码中的内存泄漏
- C++ 结构内部的unordered_map会导致内存泄漏问题吗?
- 可视化 使用 VS Code 查找C++应用程序中的内存泄漏
- Shared_ptr双链接列表内存泄漏
- C++ 在类中使用常量引用文本时 O2 内存泄漏