microsoft / microsoft/Windows-Camera
COM reference leak?
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 261
- Forks
- 81
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
Hi think there's a COM reference leak here
https://github.com/microsoft/Windows-Camera/blob/master/Samples/VirtualCamera/VirtualCameraMediaSource/SimpleMediaSource.cpp#L37
auto ptr = winrt::make_self<SimpleMediaStream>(); // +1
m_streamList[i] = ptr.detach(); // +2
It's caused by the mix between WIL and C++/WinRT
This could be fixed by something like this for example:
m_streamList[i].attach(ptr.detach());
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at VirtualCamera/VirtualCameraMediaSource/SimpleMediaSource.cpp line 37 and inspect how the C++/WinRT object is transferred into m_streamList[i]. Compare the WIL and C++/WinRT ownership at that point, then verify that the corrected ownership path no longer adds an unreleased COM reference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100