some extra object checks to catch wierdness/badness..

also fix segv if you have NO apps :)


SVN revision: 12925
This commit is contained in:
Carsten Haitzler 2005-01-12 13:59:01 +00:00
parent f937e4a170
commit 5cfae17870
2 changed files with 33 additions and 18 deletions

View File

@ -218,6 +218,8 @@ _e_int_menus_apps_scan(E_Menu *m)
a = e_object_data_get(E_OBJECT(m));
e_app_subdir_scan(a, 0);
if (a)
{
for (l = a->subapps; l; l = l->next)
{
a = l->data;
@ -240,6 +242,7 @@ _e_int_menus_apps_scan(E_Menu *m)
app_count++;
}
}
}
if (app_count == 0)
{
mi = e_menu_item_new(m);
@ -266,7 +269,7 @@ _e_int_menus_apps_del_hook(void *obj)
E_Menu_Item *mi;
mi = l->data;
if (mi->submenu) e_object_del(mi->submenu);
if (mi->submenu) e_object_del(E_OBJECT(mi->submenu));
}
}

View File

@ -184,6 +184,18 @@ e_object_error(E_Object *obj)
"%s",
obj, magic,
bt);
else if (obj->references < 0)
snprintf(buf, sizeof(buf),
"Object [%p] has negative references (%i).\n"
"%s",
obj, obj->references,
bt);
else if (obj->references > 100)
snprintf(buf, sizeof(buf),
"Object [%p] has unusually high reference count (%i).\n"
"%s",
obj, obj->references,
bt);
/* it's all ok! */
else
{