Skip to content

Commit

Permalink
Fix memory issues in LinuxWrapper
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Gervais <[email protected]>
  • Loading branch information
g-maxime committed Mar 19, 2024
1 parent 06f1b1f commit f5c9ddc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Source/Common/LinuxWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,13 @@ void LinuxWrapper::StartCaptureSession()
do
{
FrameBufferLock.lock();
if (Wrapper && !FrameBuffer.empty())
if (!FrameBuffer.empty())
{
frame Cur = FrameBuffer.back();
frame Cur = FrameBuffer.front();
FrameBuffer.pop();

Wrapper->Parse_Buffer(Cur.Data, Cur.Size);
if (Wrapper)
Wrapper->Parse_Buffer(Cur.Data, Cur.Size);
delete[] Cur.Data;
}
FrameBufferLock.unlock();
Expand Down Expand Up @@ -452,7 +453,7 @@ void LinuxWrapper::StopCaptureSession()
FrameBufferLock.lock();
while (!FrameBuffer.empty())
{
delete[] FrameBuffer.back().Data;
delete[] FrameBuffer.front().Data;
FrameBuffer.pop();
}
FrameBufferLock.unlock();
Expand Down

0 comments on commit f5c9ddc

Please sign in to comment.