schellingb / UnityCapture

Streams Unity rendered output to other Windows applications as virtual capture device
420 stars 65 forks source link

Memory Leakage when repeating create and delete instance #40

Open hansuk-kim-wst opened 4 months ago

hansuk-kim-wst commented 4 months ago

I am using UnityCaptureFilter for my project. There is a memory leakage when deleting sender instance if there is at least one receiver. Adding UnmapViewOfFile in the destructor of SharedImageMemory solves it.

~SharedImageMemory()
{
    ...
    if (m_pSharedBuf) UnmapViewOfFile(m_pSharedBuf);    // added. prevent memory leak.
}