2008-01-19 Emmanuele Bassi <ebassi@openedhand.com>

* clutter/clutter-event.c (clutter_event_copy): Take an extra
	reference on the related actor in ClutterEventCrossing that we
	explicitly unref in clutter_event_free(). (#714, Neil Roberts)
This commit is contained in:
Emmanuele Bassi 2008-01-19 10:30:29 +00:00
parent 86c2e6e734
commit 5b40709270
2 changed files with 21 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2008-01-19 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-event.c (clutter_event_copy): Take an extra
reference on the related actor in ClutterEventCrossing that we
explicitly unref in clutter_event_free(). (#714, Neil Roberts)
2008-01-18 Emmanuele Bassi <ebassi@openedhand.com>
* tests/test-actors.c (input_cb): Fix the callback signature;

View File

@ -341,6 +341,19 @@ clutter_event_copy (ClutterEvent *event)
new_event = clutter_event_new (CLUTTER_NOTHING);
*new_event = *event;
/* deep copies or references must be added here */
switch (new_event->type)
{
case CLUTTER_ENTER:
case CLUTTER_LEAVE:
if (new_event->crossing.related)
g_object_ref (new_event->crossing.related);
break;
default:
break;
}
return new_event;
}
@ -357,7 +370,8 @@ clutter_event_free (ClutterEvent *event)
{
if ((event->type == CLUTTER_LEAVE || event->type == CLUTTER_ENTER) &&
event->crossing.related)
g_object_unref (event->crossing.related);
g_object_unref (event->crossing.related);
g_slice_free (ClutterEvent, event);
}
}