[vlc-devel] [PATCH] [RFC] don't crash when detaching an event listener that wasn't attached

Steve Lhomme robux4 at gmail.com
Mon Jul 27 08:13:34 CEST 2015


---
At least on Release builds I don't see why this should crash. It should return
an error so the caller knows it did something wrong and what. That will change
libvlc ABI if we return an `int` where there's currently a `void`.
---
 lib/event.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/event.c b/lib/event.c
index 4a95cee..c2b763d 100644
--- a/lib/event.c
+++ b/lib/event.c
@@ -459,5 +459,7 @@ void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
 
     libvlc_event_async_ensure_listener_removal(p_event_manager, &listener_to_remove);
 
+#ifndef NDEBUG
     assert(found);
+#endif
 }
-- 
2.4.5




More information about the vlc-devel mailing list