[vlc-devel] commit: Win32: fix vlc_control_cancel from main() task ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sat Aug 30 18:36:17 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Aug 30 19:38:41 2008 +0300| [52be1354d2e5db60073804493a5213ad5acb9ade] | committer: Rémi Denis-Courmont
Win32: fix vlc_control_cancel from main() task
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=52be1354d2e5db60073804493a5213ad5acb9ade
---
src/misc/threads.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/misc/threads.c b/src/misc/threads.c
index 99c602a..c6f47f7 100644
--- a/src/misc/threads.c
+++ b/src/misc/threads.c
@@ -850,16 +850,19 @@ void vlc_control_cancel (int cmd, ...)
va_start (ap, cmd);
vlc_cancel_t *nfo = vlc_threadvar_get (&cancel_key);
-#ifndef WIN32
if (nfo == NULL)
{
+#ifdef WIN32
+ /* Main thread - cannot be cancelled anyway */
+ return;
+#else
nfo = malloc (sizeof (*nfo));
if (nfo == NULL)
- abort ();
+ return; /* Uho! Expect problems! */
*nfo = VLC_CANCEL_INIT;
vlc_threadvar_set (&cancel_key, nfo);
- }
#endif
+ }
switch (cmd)
{
More information about the vlc-devel
mailing list