Clear the filelist when done, fix a memory leak when deleting objects from the custom filelist.

This commit is contained in:
Jaime Thomas 2008-12-24 19:45:56 +00:00
parent 1e9d496c96
commit 9bbac64f4c
2 changed files with 16 additions and 0 deletions

View File

@ -261,6 +261,10 @@ void
ecdb_burn_data_cleanup(void) ecdb_burn_data_cleanup(void)
{ {
Evas_Object *swallow; Evas_Object *swallow;
Ewl_Widget *filelist;
Ecdb_Source *src;
int i;
const char *ids[] = {"ecdb/burn_data/return", "ecdb/burn_data/begin", const char *ids[] = {"ecdb/burn_data/return", "ecdb/burn_data/begin",
"ecdb/burn_data/file", "ecdb/burn_data/drive" "ecdb/burn_data/file", "ecdb/burn_data/drive"
"ecdb/burn_data/speed"}; "ecdb/burn_data/speed"};
@ -269,5 +273,16 @@ ecdb_burn_data_cleanup(void)
edje_object_part_text_set(swallow, "progress_text", "Burn Complete!"); edje_object_part_text_set(swallow, "progress_text", "Burn Complete!");
ecdb_gui_controls_enable(ids, 5); ecdb_gui_controls_enable(ids, 5);
edje_object_signal_emit(swallow, "ecdb,burn_data,done", "ecdb"); edje_object_signal_emit(swallow, "ecdb,burn_data,done", "ecdb");
filelist = ewl_widget_name_find("ecdb/burn_data/filelist");
src = ewl_widget_data_get(filelist, "source");
while (src->parent)
src = src->parent;
for (i = 0; i < src->num_children; i++)
{
ecdb_source_child_remove(src, src->children[i]);
ecdb_source_destroy(src->children[i]);
}
} }

View File

@ -306,6 +306,7 @@ ecdb_custom_filelist_cb_key_down(Ewl_Widget *w, void *ev, void *data)
if (!strcmp(child->dst, file)) if (!strcmp(child->dst, file))
{ {
ecdb_source_child_remove(parent, child); ecdb_source_child_remove(parent, child);
ecdb_source_destroy(child);
ecdb_custom_filelist_directory_set(fl, parent); ecdb_custom_filelist_directory_set(fl, parent);
break; break;
} }