On 03/04/2016 12:26 PM, George Kyriazis wrote:
screen may still be used by other resources that are not yet freed.
To correctly fix this there will be a need to account for resources
differently, but this quick fix is not any worse than the original
code that leaked screens anyway.
---
  src/gallium/state_trackers/glx/xlib/xm_api.c | 10 +++++++---
  1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c 
b/src/gallium/state_trackers/glx/xlib/xm_api.c
index cee4f18..5799cce 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_api.c
+++ b/src/gallium/state_trackers/glx/xlib/xm_api.c
@@ -174,9 +174,13 @@ xmesa_close_display(Display *display)
     /* don't forget to clean up mesaDisplay */
     XMesaDisplay xmdpy = &info->mesaDisplay;

-   if (xmdpy->screen) {
-      xmdpy->screen->destroy(xmdpy->screen);
-   }
+   /**
+    * XXX: Don't destroy the screens here, since there may still
+    * be some dangling screen pointers that are used after this point
+    * if (xmdpy->screen) {
+    *    xmdpy->screen->destroy(xmdpy->screen);
+    * }
+    */
     free(xmdpy->smapi);

     XFree((char *) info);


Looks OK to me.

Reviewed-by: Brian Paul <[email protected]>

I'll push this in a bit.

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to