added event paranoia for when deleteing objects - makes damn sure the grabbed

mouse button object handle and mouse object handle are NULL if we're going off
freeing / deleting this object


SVN revision: 3640
This commit is contained in:
Carsten Haitzler 2000-10-17 16:14:36 +00:00
parent a74c5544a3
commit 871a300457
1 changed files with 7 additions and 2 deletions

View File

@ -77,6 +77,8 @@ _evas_real_del_object(Evas e, Evas_Object o)
{
layer->objects = evas_list_remove(layer->objects, o);
_evas_callback_call(e, o, CALLBACK_FREE, 0, 0, 0);
if (e->mouse.object == o) e->mouse.object = NULL;
if (e->mouse.button_object == o) e->mouse.object = NULL;
_evas_remove_callbacks(e, o);
_evas_remove_data(e, o);
if (o->name) free(o->name);
@ -100,6 +102,8 @@ _evas_layer_free(Evas e, Evas_Layer layer)
o = l->data;
_evas_callback_call(e, o, CALLBACK_FREE, 0, 0, 0);
if (e->mouse.object == o) e->mouse.object = NULL;
if (e->mouse.button_object == o) e->mouse.object = NULL;
_evas_remove_callbacks(e, o);
_evas_remove_data(e, o);
o->object_renderer_data_free(e, o);
@ -116,8 +120,8 @@ evas_del_object(Evas e, Evas_Object o)
{
if (!e) return;
if (!o) return;
o->delete_me = 1;
evas_hide(e, o);
o->delete_me = 1;
}
/* layer stacking for object */
@ -500,9 +504,10 @@ evas_hide(Evas e, Evas_Object o)
o->current.visible = 0;
o->changed = 1;
e->changed = 1;
if (e->mouse.button_object == o) e->mouse.button_object = NULL;
if (_evas_point_in_object(e, o, e->mouse.x, e->mouse.y))
evas_event_move(e, e->mouse.x, e->mouse.y);
if (e->mouse.object == o) e->mouse.object = NULL;
if (e->mouse.button_object == o) e->mouse.object = NULL;
}
Evas_Object