summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-06-30 18:02:23 +0800
committerChia-I Wu <olv@lunarg.com>2010-06-30 18:32:48 +0800
commit8b0c6c4a8dc1899d56e52fe3b0a9e1165c30ecae (patch)
tree8c92befc4b999c6b67e5c30e5edb4f0bbc76ec8c /src/gallium/state_trackers
parent6717a313f26e42a7864f46f499637462a7cc3d57 (diff)
egl: Store screens in a dynamic array.
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/egl/common/egl_g3d.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c
index d7a2aa8b8e..4815a8a322 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d.c
+++ b/src/gallium/state_trackers/egl/common/egl_g3d.c
@@ -424,11 +424,18 @@ static struct native_event_handler egl_g3d_native_event_handler = {
egl_g3d_new_sw_screen
};
+static void
+egl_g3d_free_screen(void *scr)
+{
+ struct egl_g3d_screen *gscr = egl_g3d_screen((_EGLScreen *) scr);
+ FREE(gscr->native_modes);
+ FREE(gscr);
+}
+
static EGLBoolean
egl_g3d_terminate(_EGLDriver *drv, _EGLDisplay *dpy)
{
struct egl_g3d_display *gdpy = egl_g3d_display(dpy);
- EGLint i;
_eglReleaseDisplayResources(drv, dpy);
_eglCleanupDisplay(dpy);
@@ -437,12 +444,8 @@ egl_g3d_terminate(_EGLDriver *drv, _EGLDisplay *dpy)
gdpy->pipe->destroy(gdpy->pipe);
if (dpy->Screens) {
- for (i = 0; i < dpy->NumScreens; i++) {
- struct egl_g3d_screen *gscr = egl_g3d_screen(dpy->Screens[i]);
- FREE(gscr->native_modes);
- FREE(gscr);
- }
- FREE(dpy->Screens);
+ _eglDestroyArray(dpy->Screens, egl_g3d_free_screen);
+ dpy->Screens = NULL;
}
if (gdpy->smapi)