Skip to content

Commit

Permalink
framebuffer: prevent double frees by reset the buffer first
Browse files Browse the repository at this point in the history
  • Loading branch information
mguentner committed Mar 13, 2023
1 parent 109ba9f commit 30f680f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions framebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,11 @@ void FrameBuffer::clearPool() {
std::unique_lock<std::recursive_mutex> lock3(m_intermediateBufferMutex, std::defer_lock);
std::lock(lock1, lock2, lock3);

reset();

for (canfd_frame *f : m_framePool) {
delete f;
}
for (canfd_frame *f : m_intermediateBuffer) {
delete f;
}
for (canfd_frame *f : m_buffer) {
delete f;
}
m_framePool.clear();
m_totalAllocCount = 0;
}
Expand Down

0 comments on commit 30f680f

Please sign in to comment.