dect
/
asterisk
Archived
13
0
Fork 0

free memory used by the x11 grabber when closing it.

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@130733 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
rizzo 2008-07-14 16:50:54 +00:00
parent 430782b7be
commit f0794b3288
1 changed files with 5 additions and 7 deletions

View File

@ -69,6 +69,8 @@ struct grab_x11_desc {
struct fbuf_t b; /* geometry and pointer into the XImage */ struct fbuf_t b; /* geometry and pointer into the XImage */
}; };
static void *grab_x11_close(void *desc); /* forward declaration */
/*! \brief open the grabber. /*! \brief open the grabber.
* We use the special name 'X11' to indicate this grabber. * We use the special name 'X11' to indicate this grabber.
*/ */
@ -127,12 +129,7 @@ static void *grab_x11_open(const char *name, struct fbuf_t *geom, int fps)
return v; return v;
error: error:
/* XXX maybe XDestroy (v->image) ? */ return grab_x11_close(v);
if (v->dpy)
XCloseDisplay(v->dpy);
v->dpy = NULL;
ast_free(v);
return NULL;
} }
static struct fbuf_t *grab_x11_read(void *desc) static struct fbuf_t *grab_x11_read(void *desc)
@ -170,7 +167,8 @@ static void *grab_x11_close(void *desc)
{ {
struct grab_x11_desc *v = desc; struct grab_x11_desc *v = desc;
XCloseDisplay(v->dpy); if (v->dpy)
XCloseDisplay(v->dpy);
v->dpy = NULL; v->dpy = NULL;
v->image = NULL; v->image = NULL;
ast_free(v); ast_free(v);