summaryrefslogtreecommitdiff
path: root/src/driclient
diff options
context:
space:
mode:
Diffstat (limited to 'src/driclient')
-rw-r--r--src/driclient/src/driclient.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/driclient/src/driclient.c b/src/driclient/src/driclient.c
index 2d7514166f..dc2189afec 100644
--- a/src/driclient/src/driclient.c
+++ b/src/driclient/src/driclient.c
@@ -111,8 +111,23 @@ free_screen:
int driDestroyScreen(dri_screen_t *dri_screen)
{
+ Drawable draw;
+ dri_drawable_t *dri_draw;
+
assert(dri_screen);
+ if (drmHashFirst(dri_screen->drawable_hash, &draw, (void**)&dri_draw))
+ {
+ dri_draw->refcount = 1;
+ driDestroyDrawable(dri_draw);
+
+ while (drmHashNext(dri_screen->drawable_hash, &draw, (void**)&dri_draw))
+ {
+ dri_draw->refcount = 1;
+ driDestroyDrawable(dri_draw);
+ }
+ }
+
drmHashDestroy(dri_screen->drawable_hash);
drmUnmap(dri_screen->sarea, SAREA_MAX);
drmCloseOnce(dri_screen->fd);