mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 17:40:40 -05:00
Avoid a case where a struct's fields might be updated after it was freed.
* ui.[ch] (filter_func): Avoid a case where a struct's fields might be updated after it was freed. #348067.
This commit is contained in:
parent
85f9c499fb
commit
5e85bf7210
@ -1,3 +1,8 @@
|
|||||||
|
2006-07-21 Thomas Thurman <thomas@thurman.org.uk>
|
||||||
|
|
||||||
|
* ui.[ch] (filter_func): Avoid a case where a struct's
|
||||||
|
fields might be updated after it was freed. #348067.
|
||||||
|
|
||||||
2006-07-10 Elijah Newren <newren gmail com>
|
2006-07-10 Elijah Newren <newren gmail com>
|
||||||
|
|
||||||
* configure.in: post-release version bump to 2.15.13
|
* configure.in: post-release version bump to 2.15.13
|
||||||
|
15
src/ui.c
15
src/ui.c
@ -70,26 +70,29 @@ struct _EventFunc
|
|||||||
int last_event_serial;
|
int last_event_serial;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static EventFunc *ef = NULL;
|
||||||
|
|
||||||
static GdkFilterReturn
|
static GdkFilterReturn
|
||||||
filter_func (GdkXEvent *xevent,
|
filter_func (GdkXEvent *xevent,
|
||||||
GdkEvent *event,
|
GdkEvent *event,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
EventFunc *ef;
|
g_return_if_fail (ef != NULL);
|
||||||
|
|
||||||
ef = data;
|
|
||||||
|
|
||||||
if ((* ef->func) (xevent, ef->data))
|
if ((* ef->func) (xevent, ef->data))
|
||||||
return GDK_FILTER_REMOVE;
|
return GDK_FILTER_REMOVE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ef->last_event_serial = ((XEvent*)xevent)->xany.serial;
|
/* ef would be NULL here if we removed the filter function
|
||||||
|
* in response to the event.
|
||||||
|
*/
|
||||||
|
if (ef != NULL)
|
||||||
|
ef->last_event_serial = ((XEvent*)xevent)->xany.serial;
|
||||||
|
|
||||||
return GDK_FILTER_CONTINUE;
|
return GDK_FILTER_CONTINUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static EventFunc *ef = NULL;
|
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_ui_add_event_func (Display *xdisplay,
|
meta_ui_add_event_func (Display *xdisplay,
|
||||||
MetaEventFunc func,
|
MetaEventFunc func,
|
||||||
|
Loading…
Reference in New Issue
Block a user