Skip to content

Commit

Permalink
[VP] Avoid duplicate pointer in packet pipe recycle pool
Browse files Browse the repository at this point in the history
Avoid duplicate pointer in packet pipe recycle pool.
  • Loading branch information
Dylan-debug authored and intel-mediadev committed Sep 18, 2024
1 parent 5ee6c41 commit c386327
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,13 @@ void PacketPipeFactory::ReturnPacketPipe(PacketPipe *&pPipe)
return;
}
pPipe->Clean();
m_Pool.push_back(pPipe);
if (std::find(m_Pool.begin(), m_Pool.end(), pPipe) == m_Pool.end())
{
m_Pool.push_back(pPipe);
}
else
{
VP_PUBLIC_ASSERTMESSAGE("packetPipe %p is existing in m_Pool!, m_Pool size is %d.", pPipe, (uint32_t)m_Pool.size());
}
pPipe = nullptr;
}

0 comments on commit c386327

Please sign in to comment.