simple patch for the monitor module to use stringshare where it seemed
to be needed. I'm not super familiar with where stringshare needs to /
should be used, but this seems to be enough to stop enlightenment from
constantly SIGABRT-ing on shutdown or restart. I did read the
stringshare code though.. nice reminder of how hash tables with
buckets work, :)  so i think i used it correctly.

I basically just turned all strdup's for the offending var's into
evas_stringshare_add's, and their matching free's to
evas_stringshare_del's. I pretty much assumed it was written corretly
in the first place (ie, for each strdup(x), i replaced any and every
free(x))

Thanks!

d#
? .e_mod_main.c.swp
Index: e_mod_main.c
===================================================================
RCS file: /root/e17/apps/e_modules/src/modules/monitor/e_mod_main.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 e_mod_main.c
--- e_mod_main.c        1 Nov 2005 12:05:04 -0000       1.1.1.1
+++ e_mod_main.c        8 Dec 2005 07:19:22 -0000
@@ -186,9 +186,9 @@
    conf->cpu_interval = 1.0;
    conf->mem_interval = 1.0;
    conf->net_interval = 1.0;
-   conf->net_interface = strdup("eth0");
+   conf->net_interface = evas_stringshare_add("eth0");
    conf->wlan_interval = 1.0;
-   conf->wlan_interface = strdup("wlan0");
+   conf->wlan_interface = evas_stringshare_add("wlan0");
    conf->mem_real_ignore_cached = 0;
    conf->mem_real_ignore_buffers = 0;
 
@@ -685,8 +685,8 @@
    e_object_del(E_OBJECT(face->menu_cpu));
    e_object_del(E_OBJECT(face->menu));
 
-   free(face->conf->wlan_interface);
-   free(face->conf->net_interface);
+   evas_stringshare_del(face->conf->wlan_interface);
+   evas_stringshare_del(face->conf->net_interface);
    free(face->conf);
    free(face);
    _monitor_count--;
@@ -1370,7 +1370,7 @@
    Monitor_Face *face;
    face = data;
 
-   face->conf->net_interface = strdup(mi->label);
+   face->conf->net_interface = evas_stringshare_add(mi->label);
    net_interface_set(face->conf->net_interface);
    e_config_save_queue();
 }
@@ -1442,7 +1442,7 @@
    Monitor_Face *face;
    face = data;
 
-   face->conf->wlan_interface = strdup(mi->label);
+   face->conf->wlan_interface = evas_stringshare_add(mi->label);
    wlan_interface_set(face->conf->wlan_interface);
    e_config_save_queue();
 }





Reply via email to