sys/ximage/gstximagesrc.c: Free allocated Damage memory before closing our connection to the

Original commit message from CVS:
* sys/ximage/gstximagesrc.c:
Free allocated Damage memory before closing our connection to the
X server. Fixes: #515706
This commit is contained in:
Jan Schmidt 2008-02-12 11:09:08 +00:00
parent a0a9fe66fe
commit ababb87313
2 changed files with 25 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2008-02-12 Jan Schmidt <jan.schmidt@sun.com>
* sys/ximage/gstximagesrc.c:
Free allocated Damage memory before closing our connection to the
X server. Fixes: #515706
2008-02-12 Sebastian Dröge <slomo@circular-chaos.org> 2008-02-12 Sebastian Dröge <slomo@circular-chaos.org>
* ext/jpeg/gstsmokeenc.c: (gst_smokeenc_chain): * ext/jpeg/gstsmokeenc.c: (gst_smokeenc_chain):

View file

@ -206,6 +206,9 @@ gst_ximage_src_start (GstBaseSrc * basesrc)
s->last_frame_no = -1; s->last_frame_no = -1;
#ifdef HAVE_XDAMAGE #ifdef HAVE_XDAMAGE
s->last_ximage = NULL; s->last_ximage = NULL;
s->damage = None;
s->damage_copy_gc = None;
s->damage_region = None;
#endif #endif
return gst_ximage_src_open_display (s, s->display_name); return gst_ximage_src_open_display (s, s->display_name);
} }
@ -219,6 +222,22 @@ gst_ximage_src_stop (GstBaseSrc * basesrc)
if (src->xcontext) { if (src->xcontext) {
g_mutex_lock (src->x_lock); g_mutex_lock (src->x_lock);
#ifdef HAVE_XDAMAGE
if (src->damage_copy_gc != None) {
XFreeGC (src->xcontext->disp, src->damage_copy_gc);
src->damage_copy_gc = None;
}
if (src->damage_region != None) {
XFixesDestroyRegion (src->xcontext->disp, src->damage_region);
src->damage_region = None;
}
if (src->damage != None) {
XDamageDestroy (src->xcontext->disp, src->damage);
src->damage = None;
}
#endif
ximageutil_xcontext_clear (src->xcontext); ximageutil_xcontext_clear (src->xcontext);
src->xcontext = NULL; src->xcontext = NULL;
g_mutex_unlock (src->x_lock); g_mutex_unlock (src->x_lock);