From 31732f7c68c4c6c6619285fa23b253dbae2e986b Mon Sep 17 00:00:00 2001 From: vivek Date: Thu, 15 May 2014 18:58:16 +0530 Subject: Clients: Fix memleak issues in various clients of weston In many clients of weston, Display was not being destroyed so added it. Also destroy windows, widgets which were not being destroyed. Signed-off-by: vivek Reviewed-by: Pekka Paalanen Reviewed-by: Bryce Harrington --- clients/cliptest.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'clients/cliptest.c') diff --git a/clients/cliptest.c b/clients/cliptest.c index 3cee343f..a1928f40 100644 --- a/clients/cliptest.c +++ b/clients/cliptest.c @@ -879,6 +879,14 @@ benchmark(void) return 0; } +static void +cliptest_destroy(struct cliptest *cliptest) +{ + widget_destroy(cliptest->widget); + window_destroy(cliptest->window); + free(cliptest); +} + int main(int argc, char *argv[]) { @@ -897,9 +905,8 @@ main(int argc, char *argv[]) cliptest = cliptest_create(d); display_run(d); - widget_destroy(cliptest->widget); - window_destroy(cliptest->window); - free(cliptest); + cliptest_destroy(cliptest); + display_destroy(d); return 0; } -- cgit v1.2.1