summaryrefslogtreecommitdiff
path: root/src/sna/sna_video.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-06-12 14:23:32 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-06-12 14:34:05 +0100
commit1f180b89db412c5fa9fe95c8f6634be33a1d8581 (patch)
treea9e7be55ad2f65c0373a966cbbc4aba22d210977 /src/sna/sna_video.c
parent04ea469d4f30f9bb25561f3d04f1463999c8d928 (diff)
sna/video: Free the private video (adaptor/port) arrays upon CloseScreen
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_video.c')
-rw-r--r--src/sna/sna_video.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/sna/sna_video.c b/src/sna/sna_video.c
index 6591c625..833e6f23 100644
--- a/src/sna/sna_video.c
+++ b/src/sna/sna_video.c
@@ -606,8 +606,21 @@ sna_xv_query_adaptors(ScreenPtr screen,
}
static Bool
-sna_xv_close_screen(ScreenPtr screen)
+sna_xv_close_screen(CLOSE_SCREEN_ARGS_DECL)
{
+ struct sna *sna = to_sna_from_screen(screen);
+ int i;
+
+ for (i = 0; i < sna->xv.num_adaptors; i++) {
+ free(sna->xv.adaptors[i].pPorts->devPriv.ptr);
+ free(sna->xv.adaptors[i].pPorts);
+ free(sna->xv.adaptors[i].pEncodings);
+ }
+ free(sna->xv.adaptors);
+
+ sna->xv.adaptors = NULL;
+ sna->xv.num_adaptors = 0;
+
return TRUE;
}