Have to clearpacket while holding the lock on snap. Otherwise it can get deleted the moment we unlock it.

This commit is contained in:
Isaac Connor 2021-05-08 12:26:13 -04:00
parent ff0d6e8e0f
commit bd6566a819
1 changed files with 1 additions and 1 deletions

View File

@ -2304,6 +2304,7 @@ bool Monitor::Analyse() {
snap->image = nullptr;
}
packetqueue.clearPackets(snap);
packetqueue.unlock(packet_lock);
if ( snap->image_index > 0 ) {
@ -2314,7 +2315,6 @@ bool Monitor::Analyse() {
UpdateAnalysisFPS();
}
shared_data->last_read_time = time(nullptr);
packetqueue.clearPackets(snap);
return true;
} // end Monitor::Analyse