Skip to content

Commit 65b1fd6

Browse files
committed
Comments.
1 parent 2f9bb06 commit 65b1fd6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

SerialPrograms/Source/CommonFramework/VideoPipeline/Backends/SnapshotManager.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ void SnapshotManager::convert(uint64_t seqnum, QVideoFrame frame, WallClock time
6464
}
6565

6666
m_active_conversions--;
67-
m_cv.notify_all();
6867

6968
if (m_queued_convert){
7069
m_queued_convert = false;
@@ -73,6 +72,14 @@ void SnapshotManager::convert(uint64_t seqnum, QVideoFrame frame, WallClock time
7372
dispatch_conversion(seqnum, std::move(frame), timestamp);
7473
}
7574
}
75+
76+
// Warning: The moment we release the lock with (m_active_conversions == 0),
77+
// this class can be immediately destructed.
78+
79+
// Therefore it is not safe to notify after releasing the lock.
80+
m_cv.notify_all();
81+
82+
// Lock is implicitly released here.
7683
}
7784
bool SnapshotManager::try_dispatch_conversion(uint64_t seqnum, QVideoFrame frame, WallClock timestamp) noexcept{
7885
// Must call under the lock.

0 commit comments

Comments
 (0)