1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-05 10:27:26 -04:00
Files
sdrangel/sdrbase
Robin Getz 0928de3b7b deviceapi: Avoid iterator invalidation when clearing buddy lists
Fix cppcheck warning:
    Using iterator to member container 'm_sinkBuddies' that may be invalid

clearBuddiesLists() was iterating directly over m_sourceBuddies and
m_sinkBuddies while calling removeBuddy(), which modifies the buddy
relationship lists. This could invalidate the active iterator and result in
undefined behavior.

The issue could lead to intermittent failures during buddy cleanup operations,
such as device removal, device reload, or application shutdown, depending on
container state and timing.

Iterate over copies of the buddy lists so that removing relationships does not
affect the iterators used for traversal.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-08-01 17:06:39 -04:00
..
2026-03-25 19:06:11 +00:00
2024-09-05 13:37:46 +03:00
2024-10-21 17:09:32 +01:00