From 74b63dd741b07f1a67cc75303a36db44c35c47a8 Mon Sep 17 00:00:00 2001 From: Liong Sauw Ming Date: Wed, 24 Aug 2011 08:00:30 +0000 Subject: Fixed #1334: Fix the problem of getting stuck when trying to quit SDL. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3720 74dad513-b988-da41-8d7b-12977e46ad98 --- pjmedia/src/pjmedia-videodev/sdl_dev.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pjmedia') diff --git a/pjmedia/src/pjmedia-videodev/sdl_dev.c b/pjmedia/src/pjmedia-videodev/sdl_dev.c index d9b1305c..91fb733b 100644 --- a/pjmedia/src/pjmedia-videodev/sdl_dev.c +++ b/pjmedia/src/pjmedia-videodev/sdl_dev.c @@ -521,6 +521,13 @@ static pj_status_t sdl_factory_destroy(pjmedia_vid_dev_factory *f) sf->is_quitting = PJ_TRUE; if (sf->sdl_thread) { pj_sem_post(sf->sem); +#if defined(PJ_DARWINOS) && PJ_DARWINOS!=0 + /* To prevent pj_thread_join() of getting stuck if we are in + * the main thread and we haven't finished processing the job + * posted by sdl_thread. + */ + CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false); +#endif pj_thread_join(sf->sdl_thread); } -- cgit v1.2.3