delete packet_lock if failed trylock
This commit is contained in:
parent
649f7906de
commit
a1364a2b2b
|
@ -98,7 +98,7 @@ bool PacketQueue::queuePacket(ZMPacket* add_packet) {
|
|||
ZMLockedPacket *lp = new ZMLockedPacket(zm_packet);
|
||||
if (!lp->trylock()) {
|
||||
Debug(1, "Found locked packet when trying to free up video packets. Can't continue");
|
||||
//delete lp;
|
||||
delete lp;
|
||||
break;
|
||||
}
|
||||
delete lp;
|
||||
|
@ -543,6 +543,7 @@ ZMLockedPacket *PacketQueue::get_packet(packetqueue_iterator *it) {
|
|||
Error("Null p?!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ZMLockedPacket *lp = new ZMLockedPacket(p);
|
||||
Debug(3, "get_packet %p image_index: %d, about to lock packet", p, p->image_index);
|
||||
while (!(zm_terminate or deleting) and !lp->trylock()) {
|
||||
|
|
Loading…
Reference in New Issue