Windows 10, Visual Studio 2022, OpenCV 4.80 compiled successfully with Visual Studio to static libs.
With this minimal example linked with the static libs I get memory leaks
#include <opencv2\opencv.hpp>
int main()
{
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
cv::VideoCapture cap(0, cv::CAP_DSHOW); *// Also tried cv::CAP_MSMF, cv::CAP_ANY*
cap.release();
}
At program termination I get lots of these:
Detected memory leaks!
Dumping objects ->
{473} normal block at 0x0000022AF8B34460, 16 bytes long.
Data: < wA > F0 77 41 03 F7 7F 00 00 01 00 00 00 CD CD CD CD
{260} normal block at 0x0000022AF8B29D00, 40 bytes long.
Data: <P * P * > 50 9E B2 F8 2A 02 00 00 50 9E B2 F8 2A 02 00 00
{259} normal block at 0x0000022AF8B29980, 40 bytes long.
Data: < * * > 90 9C B2 F8 2A 02 00 00 90 9C B2 F8 2A 02 00 00
{258} normal block at 0x0000022AF8B33410, 16 bytes long.
Data: <0! * > 30 21 B3 F8 2A 02 00 00 00 00 00 00 00 00 00 00
… etc …