[PATCH xvinfo] Resource cleanup fixes

Jeff Smith whydoubt at yahoo.com
Sat Mar 20 00:03:58 PDT 2010


Running xvinfo through valgrind (with no arguments to xvinfo) and
'no adaptors present' produced "still reachable: 41,247 bytes in 31 blocks."
This patch reduces this to "still reachable: 35 bytes in 2 blocks."

Signed-off-by: Jeff Smith <whydoubt at yahoo.com>
---
 xvinfo.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xvinfo.c b/xvinfo.c
index ea3b662..46c143b 100644
--- a/xvinfo.c
+++ b/xvinfo.c
@@ -58,6 +58,7 @@ int main(int argc, char *argv[])
     {
 	fprintf(stderr, "xvinfo: No X-Video Extension on %s\n",
                         (disname != NULL) ? disname : XDisplayName(NULL));
+	XCloseDisplay(dpy);
 	exit(0);
     } 
     else
@@ -284,5 +285,6 @@ int main(int argc, char *argv[])
 
 	XvFreeAdaptorInfo(ainfo);
     }
+    XCloseDisplay(dpy);
     return 1;
 }
-- 
1.6.0.6

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the xorg-devel mailing list