From df9da57e4f9b0e335075425e14580db5ab772f38 Mon Sep 17 00:00:00 2001 From: Yonghye Kwon Date: Mon, 20 Jul 2026 20:20:55 +0900 Subject: [PATCH] videoio(MSMF): close SourceReaderCB event handle SourceReaderCB owns an Event created for asynchronous frame delivery, but its destructor did not close the handle. Close it when the callback is destroyed to prevent one Event handle from leaking across repeated MSMF capture lifecycles. Fixes #29562 --- modules/videoio/src/cap_msmf.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/videoio/src/cap_msmf.cpp b/modules/videoio/src/cap_msmf.cpp index cc9e5e335e..3cf1b25d4b 100644 --- a/modules/videoio/src/cap_msmf.cpp +++ b/modules/videoio/src/cap_msmf.cpp @@ -566,6 +566,8 @@ private: // Destructor is private. Caller should call Release. virtual ~SourceReaderCB() { + if (m_hEvent) + CloseHandle(m_hEvent); CV_LOG_INFO(NULL, "terminating async callback"); }