Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_int_menus.c e_object.c 


Log Message:


some extra object checks to catch wierdness/badness..

also fix segv if you have NO apps :)

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_int_menus.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -3 -r1.30 -r1.31
--- e_int_menus.c       12 Jan 2005 09:22:44 -0000      1.30
+++ e_int_menus.c       12 Jan 2005 13:59:01 -0000      1.31
@@ -218,26 +218,29 @@
    
    a = e_object_data_get(E_OBJECT(m));
    e_app_subdir_scan(a, 0);
-   for (l = a->subapps; l; l = l->next)
+   if (a)
      {
-       a = l->data;
-       
-       mi = e_menu_item_new(m);
-       e_menu_item_label_set(mi, a->name);
-       if (a->exe)
+       for (l = a->subapps; l; l = l->next)
          {
-            e_menu_item_icon_edje_set(mi, a->path, "icon");
-            e_menu_item_callback_set(mi, _e_int_menus_apps_run, a);
-            app_count++;
-         }
-       else
-         {
-            char buf[4096];
+            a = l->data;
             
-            snprintf(buf, sizeof(buf), "%s/.directory.eet", a->path);
-            e_menu_item_icon_edje_set(mi, buf, "icon");
-            e_menu_item_submenu_set(mi, e_int_menus_apps_new(a->path));
-            app_count++;
+            mi = e_menu_item_new(m);
+            e_menu_item_label_set(mi, a->name);
+            if (a->exe)
+              {
+                 e_menu_item_icon_edje_set(mi, a->path, "icon");
+                 e_menu_item_callback_set(mi, _e_int_menus_apps_run, a);
+                 app_count++;
+              }
+            else
+              {
+                 char buf[4096];
+                 
+                 snprintf(buf, sizeof(buf), "%s/.directory.eet", a->path);
+                 e_menu_item_icon_edje_set(mi, buf, "icon");
+                 e_menu_item_submenu_set(mi, e_int_menus_apps_new(a->path));
+                 app_count++;
+              }
          }
      }
    if (app_count == 0)
@@ -266,7 +269,7 @@
        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));
      }
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_object.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_object.c  12 Jan 2005 09:22:44 -0000      1.4
+++ e_object.c  12 Jan 2005 13:59:01 -0000      1.5
@@ -184,6 +184,18 @@
                        "%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
               {




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to