mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 22:45:39 +00:00
free memory used by the x11 grabber when closing it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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,6 +167,7 @@ static void *grab_x11_close(void *desc)
|
|||||||
{
|
{
|
||||||
struct grab_x11_desc *v = desc;
|
struct grab_x11_desc *v = desc;
|
||||||
|
|
||||||
|
if (v->dpy)
|
||||||
XCloseDisplay(v->dpy);
|
XCloseDisplay(v->dpy);
|
||||||
v->dpy = NULL;
|
v->dpy = NULL;
|
||||||
v->image = NULL;
|
v->image = NULL;
|
||||||
|
Reference in New Issue
Block a user