summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2015-11-09 14:51:56 -0700
committerBrian Paul <[email protected]>2015-11-11 09:38:22 -0700
commiteb812921ac3a9b43e2cdd5dc65db34ba3fe9189b (patch)
tree6a81fe492be8ec27803f18f5be472392a1b9e8f4 /src/gallium
parente42a29531ae3d5dedb72011da2947357dfa8715b (diff)
st/wgl: fix locking issue in stw_st_framebuffer_present_locked()
When stw_st_framebuffer_present_locked() is called, the stw_framebuffer's mutex will already be locked. Normally, the stw_framebuffer_present_locked() function calls stw_framebuffer_release() to unlock the mutex when it's done. But if for some reason the 'resource' pointer in stw_st_framebuffer_present_locked() is null, we'd return without unlocking the stw_framebuffer. This fixes that to avoid potential deadlocks. Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/wgl/stw_st.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/wgl/stw_st.c b/src/gallium/state_trackers/wgl/stw_st.c
index b41171a9195..2d5d4379932 100644
--- a/src/gallium/state_trackers/wgl/stw_st.c
+++ b/src/gallium/state_trackers/wgl/stw_st.c
@@ -169,6 +169,9 @@ stw_st_framebuffer_present_locked(HDC hdc,
if (resource) {
stw_framebuffer_present_locked(hdc, stwfb->fb, resource);
}
+ else {
+ stw_framebuffer_release(stwfb->fb);
+ }
return TRUE;
}