<div dir="ltr">Any feedback on this?</div><div class="gmail_extra"><br><div class="gmail_quote">On 1 June 2018 at 12:16, Cameron Kumar <span dir="ltr"><<a href="mailto:ckumar@feralinteractive.com" target="_blank">ckumar@feralinteractive.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The queue_manager thread can access the images from x11_present_to_x11,<br>
hence this reorder prevents dereferencing of dangling pointers.<br>
<br>
Cc: "18.1" <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.<wbr>freedesktop.org</a>><br>
---<br>
src/vulkan/wsi/wsi_common_x11.<wbr>c | 6 +++---<br>
1 file changed, 3 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/vulkan/wsi/wsi_common_<wbr>x11.c b/src/vulkan/wsi/wsi_common_<wbr>x11.c<br>
index 1bfbc7c300..20d7cf5a2c 100644<br>
--- a/src/vulkan/wsi/wsi_common_<wbr>x11.c<br>
+++ b/src/vulkan/wsi/wsi_common_<wbr>x11.c<br>
@@ -1235,9 +1235,6 @@ x11_swapchain_destroy(struct wsi_swapchain *anv_chain,<br>
struct x11_swapchain *chain = (struct x11_swapchain *)anv_chain;<br>
xcb_void_cookie_t cookie;<br>
<br>
- for (uint32_t i = 0; i < chain->base.image_count; i++)<br>
- x11_image_finish(chain, pAllocator, &chain->images[i]);<br>
-<br>
if (chain->threaded) {<br>
chain->status = VK_ERROR_OUT_OF_DATE_KHR;<br>
/* Push a UINT32_MAX to wake up the manager */<br>
@@ -1247,6 +1244,9 @@ x11_swapchain_destroy(struct wsi_swapchain *anv_chain,<br>
wsi_queue_destroy(&chain-><wbr>present_queue);<br>
}<br>
<br>
+ for (uint32_t i = 0; i < chain->base.image_count; i++)<br>
+ x11_image_finish(chain, pAllocator, &chain->images[i]);<br>
+<br>
xcb_unregister_for_special_<wbr>event(chain->conn, chain->special_event);<br>
cookie = xcb_present_select_input_<wbr>checked(chain->conn, chain->event_id,<br>
chain->window,<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.14.3<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>