Skip to content

Commit adbfd09

Browse files
committed
Fix image leak if a parallel encoder quit without encoding all pending images
1 parent 4df4378 commit adbfd09

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/video.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,6 +1408,12 @@ void capture_async(
14081408
std::move(hwdevice),
14091409
ref->reinit_event, *ref->encoder_p,
14101410
channel_data);
1411+
1412+
// Free images that weren't consumed by the encoder before it quit.
1413+
// This is critical to allow the display_t to be freed correctly.
1414+
while(images->peek()) {
1415+
images->pop();
1416+
}
14111417
}
14121418
}
14131419

0 commit comments

Comments
 (0)