egl_dri2: fix double free on drm platforms
authorEmil Velikov <emil.l.velikov@gmail.com>
Fri, 7 Nov 2014 03:33:56 +0000 (03:33 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 7 Nov 2014 18:29:08 +0000 (18:29 +0000)
commit38cec0303be9ef79facbb2c8f73eb6a2f77e82ca
tree08250234d81c262e3676a196bf6145d3b56c3b3e
parent9a0a4d67a9150ad18f06ab48641205b8ff2da816
egl_dri2: fix double free on drm platforms

Earlier commit failed to attribure that for drm platforms one does not
call dri2_create_screen, thus it does not create the screen and
driver_configs but inherits them from the "display" - gbm.

As such wrap cleanup in Platform != _EGL_PLATFORM_DRM to prevent
the issue and still cleanup correctly for non-drm platforms.

v2:
 - Drop the ifdef HAVE_DRM_PLATFORM, reindent the code and fix the
comment block. Suggested by Ken.

Reported-by: Kenneth Graunke <kenneth@whitecape.org>
Reported-by: Mark Janes <mark.a.janes@intel.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
src/egl/drivers/dri2/egl_dri2.c