当前位置: 代码迷 >> VC >> VS2012 释放vector<Mat>内存时候出错,不知道什么有关问题
  详细解决方案

VS2012 释放vector<Mat>内存时候出错,不知道什么有关问题

热度:454   发布时间:2016-05-05 00:11:43.0
VS2012 释放vector<Mat>内存时候出错,不知道什么问题
HEAP[MWO3.exe]: Invalid address specified to RtlValidateHeap( 00690000, 033216A0 )
MWO3.exe 已触发了一个断点。
Debug Assertion Failed!

Program: E:\opencv_vs2012\MyWrite\MyWriteOpencv3\Debug\MWO3.exe
File: f:\dd\vctools\crt_bld\self_x86\crt\src\dbgheap.c
Line: 1322

Expression: _CrtIsValidHeapPointer(pUserData)

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

(Press Retry to debug the application)
线程 0x1c48 已退出,返回值为 3 (0x3)。
线程 0x1d50 已退出,返回值为 3 (0x3)。
线程 0x1c78 已退出,返回值为 3 (0x3)。
线程 0x1ebc 已退出,返回值为 3 (0x3)。
线程 0x1f3c 已退出,返回值为 3 (0x3)。
线程 0x1d20 已退出,返回值为 3 (0x3)。
线程 0x141c 已退出,返回值为 3 (0x3)。
线程 0x1c58 已退出,返回值为 3 (0x3)。
线程 0x1164 已退出,返回值为 3 (0x3)。
程序“[6264] MWO3.exe”已退出,返回值为 3 (0x3)。

错误码,程序没错,在最后return的时候出错,似乎是释放内存的问题。
使用vector<Mat>().swap(projections);提前释放内存也是错的,找到具体条目,可惜无法放弃不用。。。

------解决方案--------------------
用c++ 就要能准确把握你的程序所有的资源,而不是只在语言层面的了解他
  相关解决方案