On 2018-04-24 09:13 AM, Johan Helsing wrote:
> Emil: Your alternative patch won't work because dri_make_current is not 
> necessarily called with NULL after a buffer has been destroyed.
> 
> 
> The problematic sequence is a pattern we use in QtWayland:
> 
> 
> //create temporary context
> 
> surface1 = eglCreateWindowSurface() <-- dri_drawable pointer is malloced
> 
> eglMakeCurrent(surface1) <-- ctx->dPriv is set
> 
> 
> // ... (Get some information about available GL extensions etc)
> 
> 
> eglDestroySurface(surface1) <-- pointer is freed, ctx->dPriv is now dangling

Is this the problem? The memory pointed to by ctx->dPriv shouldn't be
freed as long as the surface is bound to the current context?


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to