summaryrefslogtreecommitdiff
path: root/pjmedia
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2011-08-24 08:00:30 +0000
committerLiong Sauw Ming <ming@teluu.com>2011-08-24 08:00:30 +0000
commit74b63dd741b07f1a67cc75303a36db44c35c47a8 (patch)
tree50f0b4949e2c5924a7a5b24d5f832045e8cec50f /pjmedia
parentfbf764dc08de654b992e1d91eb4392cc8a3dbb0a (diff)
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
Diffstat (limited to 'pjmedia')
-rw-r--r--pjmedia/src/pjmedia-videodev/sdl_dev.c7
1 files changed, 7 insertions, 0 deletions
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);
}