[vlc-devel] commit: libvlc: Make sure we don' t attempt to delete the current event manager and object from one of its observer callback . (Pierre d'Herbemont )

git version control git at videolan.org
Fri Jun 5 07:43:45 CEST 2009


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Thu Jun  4 22:43:03 2009 -0700| [2a0c3f8791175202c45db659ba037f15ee381ec3] | committer: Pierre d'Herbemont 

libvlc: Make sure we don't attempt to delete the current event manager and object from one of its observer callback.

This is not yet supported.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2a0c3f8791175202c45db659ba037f15ee381ec3
---

 src/control/event_async.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/control/event_async.c b/src/control/event_async.c
index e8f9a08..669a030 100644
--- a/src/control/event_async.c
+++ b/src/control/event_async.c
@@ -215,6 +215,12 @@ libvlc_event_async_ensure_listener_removal(libvlc_event_manager_t * p_em, libvlc
 {
     if(!is_queue_initialized(p_em)) return;
 
+    if(current_thread_is_asynch_thread(p_em))
+    {
+        fprintf(stderr, "*** Error: releasing the last reference of the observed object from its callback thread is not (yet!) supported\n");
+        abort();
+    }
+
     queue_lock(p_em);
     pop_listener(p_em, listener);
     




More information about the vlc-devel mailing list