changeset 85:c9449a0e11c5

We don't want to call dw_render_redraw() with the draw mutex locked. Since we no longer wait for the mutex in the expose callback, on platforms that trigger expose immediately, if we are holding the mutex it will fail to draw.
author Brian Smith <brian@dbsoft.org>
date Thu, 16 Dec 2021 09:57:36 -0600
parents 5d11b526472e
children fe6c1a45f2e9
files cc.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/cc.c	Thu Dec 16 09:20:24 2021 -0600
+++ b/cc.c	Thu Dec 16 09:57:36 2021 -0600
@@ -468,7 +468,15 @@
 			if(gList[z].Update)
 				gList[z].Update(&gList[z], 0);
 			if(gList[z].Draw && gList[z].hwndDraw && !(gList[z].Flags & fHidden))
+			{
+				/* Unlock the mutex to call render redaw.
+				 * We don't want to be holding the mutext if it calls
+				 * the expose callback immediately.
+				 */
+				dw_mutex_unlock(hMtx);
 				dw_render_redraw(gList[z].hwndDraw[0]);
+				dw_mutex_lock(hMtx);
+			}
 			z++;
 		}
 		dw_mutex_unlock(hMtx);