Skip to content

COM reference leak? #58

@smourier

Description

@smourier

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());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions