[svn-commits] rizzo: trunk r130733 - /trunk/channels/vgrabbers.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jul 14 11:50:54 CDT 2008


Author: rizzo
Date: Mon Jul 14 11:50:54 2008
New Revision: 130733

URL: http://svn.digium.com/view/asterisk?view=rev&rev=130733
Log:
free memory used by the x11 grabber when closing it.


Modified:
    trunk/channels/vgrabbers.c

Modified: trunk/channels/vgrabbers.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/vgrabbers.c?view=diff&rev=130733&r1=130732&r2=130733
==============================================================================
--- trunk/channels/vgrabbers.c (original)
+++ trunk/channels/vgrabbers.c Mon Jul 14 11:50:54 2008
@@ -69,6 +69,8 @@
 	struct fbuf_t	b;		/* geometry and pointer into the XImage */
 };
 
+static void *grab_x11_close(void *desc);	/* forward declaration */
+
 /*! \brief open the grabber.
  * We use the special name 'X11' to indicate this grabber.
  */
@@ -127,12 +129,7 @@
 	return v;
 
 error:
-	/* XXX maybe XDestroy (v->image) ? */
-	if (v->dpy)
-		XCloseDisplay(v->dpy);
-	v->dpy = NULL;
-	ast_free(v);
-	return NULL;
+	return grab_x11_close(v);
 }
 
 static struct fbuf_t *grab_x11_read(void *desc)
@@ -170,7 +167,8 @@
 {
 	struct grab_x11_desc *v = desc;
 
-	XCloseDisplay(v->dpy);
+	if (v->dpy)
+		XCloseDisplay(v->dpy);
 	v->dpy = NULL;
 	v->image = NULL;
 	ast_free(v);




More information about the svn-commits mailing list