Skip to contentSkip to conversation

frame-watch: Actually unregister removed groups

PATCH In review Andrew Zaborowski 2 participants 3 messages Feb 4, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 frame-watch: Actually unregister removed groups

Actually close the sockets for removed groups an free resources

---
 src/frame-xchg.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
src/frame-xchg.c +3 -1
index 0a6c1fc6..4c8b4a9f 100644
@@ -362,8 +362,10 @@ static bool frame_watch_group_remove_wdev(void *data, void *user_data)
 	struct watch_group *group = data;
 	const uint64_t *wdev_id = user_data;
 
-	if (group->wdev_id == *wdev_id)
+	if (group->wdev_id == *wdev_id) {
+		frame_watch_group_destroy(group);
 		return true;
+	}
 
 	if (group->id != 0)
 		return false;
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/2 frame-watch: Fix an l_queue_foreach_remove call

A pointer to the wdev_id is expected in this call inside frame_watch_group_remove_wdev instead of a pointer to the pointer.

---
 src/frame-xchg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
src/frame-xchg.c +1 -2
index 4c8b4a9f..31d9c229 100644
@@ -375,8 +375,7 @@ static bool frame_watch_group_remove_wdev(void *data, void *user_data)
 	 * internals.
 	 */
 	l_queue_foreach_remove(group->watches.items,
-				frame_watch_item_remove_wdev,
-				&wdev_id);
+				frame_watch_item_remove_wdev, user_data);
 	return false;
 }
 
Signature · 1 line
2.20.1
#2 lore raw
In reply to Andrew Zaborowski

Hi Andrew,

Quoted 5 lines · Andrew Zaborowski

Actually close the sockets for removed groups an free resources

---
  src/frame-xchg.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

Both applied, thanks.

Regards,
-Denis