summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/wgl
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2017-10-16 16:35:18 +0200
committerMichel Dänzer <[email protected]>2017-10-18 18:28:00 +0200
commit7561da367baeb49c848dc49b65e252deb6428422 (patch)
treeb8cb6f3be16db6fe2bef58958fafde9d7663d39b /src/gallium/state_trackers/wgl
parent47273d7312cb5b5b6b0b9faa814d574bbbce1c01 (diff)
st/mesa: Initialize textures array in st_framebuffer_validate
And just reference pipe_resources to it in the validate callbacks. Avoids pipe_resource leaks when st_framebuffer_validate ends up calling the validate callback multiple times, e.g. when a window is resized. v2: * Use generic stable tag instead of Fixes: tag, since the problem could already happen before the commit referenced in v1 (Thomas Hellstrom) * Use memset to initialize the array on the stack instead of allocating the array with os_calloc. Cc: [email protected] Reviewed-by: Thomas Hellstrom <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/wgl')
-rw-r--r--src/gallium/state_trackers/wgl/stw_st.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/wgl/stw_st.c b/src/gallium/state_trackers/wgl/stw_st.c
index 5e165c89f56..7cf18f0a8b0 100644
--- a/src/gallium/state_trackers/wgl/stw_st.c
+++ b/src/gallium/state_trackers/wgl/stw_st.c
@@ -161,10 +161,8 @@ stw_st_framebuffer_validate(struct st_context_iface *stctx,
stwfb->fb->must_resize = FALSE;
}
- for (i = 0; i < count; i++) {
- out[i] = NULL;
+ for (i = 0; i < count; i++)
pipe_resource_reference(&out[i], stwfb->textures[statts[i]]);
- }
stw_framebuffer_unlock(stwfb->fb);