Enlightenment CVS committal Author : raster Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/lib/canvas Modified Files: evas_events.c evas_object_textblock.c Log Message: 1. found leak in event code - fix. 2. fix leak in textblock - much better now =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/canvas/evas_events.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- evas_events.c 20 Jan 2005 06:54:44 -0000 1.30 +++ evas_events.c 30 Jan 2005 11:41:00 -0000 1.31 @@ -343,6 +343,7 @@ if (!e->events_frozen) evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_WHEEL, &ev); } + if (copy) copy = evas_list_free(copy); return; } @@ -637,6 +638,7 @@ evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev); } } + if (copy) copy = evas_list_free(copy); /* free our old list of ins */ e->pointer.object.in = evas_list_free(e->pointer.object.in); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/canvas/evas_object_textblock.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- evas_object_textblock.c 30 Jan 2005 10:22:47 -0000 1.6 +++ evas_object_textblock.c 30 Jan 2005 11:41:01 -0000 1.7 @@ -27,7 +27,7 @@ unsigned char r, g, b, a; } color, underline_color, outline_color, shadow_color; struct { - Evas_Coord x, y, ascent, descent, mascent, mdescent; + int x, y, ascent, descent, mascent, mdescent; } line; double align; }; @@ -109,21 +109,7 @@ static char * evas_object_textblock_format_merge(char *ofmt, char *fmt) { - int l1 = 0, l2 = 0; - char *buf; - return strdup(fmt); - /* this is more correct */ - if (ofmt) l1 = strlen(ofmt); - if (fmt) l2 = strlen(fmt); - buf = malloc(l1 + 1 + l2 + 1); - if (ofmt) strcpy(buf, ofmt); - strcpy(ofmt + l1, " "); - if (fmt) strcpy(buf + l1 + 1, fmt); - /* FIXME: sanitise buf */ - return strdup(buf); - /* FIXME: actually merge */ - /* snprintf to a buffer, return strdup buffer */ } static int @@ -143,11 +129,16 @@ if (layout->font.name) free(layout->font.name); layout->font.name = strdup(data); } - if (!strcmp(key, "size")) + else if (!strcmp(key, "font_source")) + { + if (layout->font.source) free(layout->font.source); + layout->font.source = strdup(data); + } + else if (!strcmp(key, "size")) { layout->font.size = atoi(data); } - if (!strcmp(key, "color")) + else if (!strcmp(key, "color")) { /* #RRGGBB[AA] or #RGB[A] */ if (data[0] == '#') @@ -291,7 +282,6 @@ } } while (*p); - } static void @@ -299,6 +289,7 @@ { *layout_dst = *layout; if (layout->font.name) layout_dst->font.name = strdup(layout->font.name); + if (layout->font.source) layout_dst->font.source = strdup(layout->font.source); } static void @@ -354,7 +345,7 @@ Evas_Object_List *l, *ll; Evas_Coord w, h; Layout_Node *line_start = NULL; - + o = (Evas_Object_Textblock *)(obj->object_data); /* FIXME: takes nodes and produce layotu nodes */ evas_object_textblock_layout_init(&layout); @@ -448,6 +439,9 @@ /* the first char can't fit. put it in there anyway */ /* FIXME */ free(text); + if (lnode->text) free(lnode->text); + evas_object_textblock_layout_clear(obj, &(lnode->layout)); + free(lnode); } else { @@ -495,6 +489,7 @@ */ } } + evas_object_textblock_layout_clear(obj, &layout); } static void @@ -1092,14 +1087,16 @@ } if (o->changed) { +/* Evas_Rectangle *r; r = malloc(sizeof(Evas_Rectangle)); r->x = 0; r->y = 0; r->w = obj->cur.geometry.w; r->h = obj->cur.geometry.h; - updates = evas_object_render_pre_prev_cur_add(updates, obj); updates = evas_list_append(updates, r); +*/ + updates = evas_object_render_pre_prev_cur_add(updates, obj); evas_object_textblock_layout_clean(obj); evas_object_textblock_layout(obj); o->changed = 0; ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs