elm_code line: move freeing to the line file

This commit is contained in:
Andy Williams 2015-03-08 11:15:31 +01:00
parent ed521af168
commit e951c13e91
3 changed files with 16 additions and 7 deletions

View File

@ -136,9 +136,7 @@ EAPI void elm_code_file_free(Elm_Code_File *file)
EINA_LIST_FREE(file->lines, l)
{
if (l->modified)
free(l->modified);
free(l);
elm_code_line_free(l);
}
if (file->file)
@ -172,10 +170,7 @@ EAPI void elm_code_file_clear(Elm_Code_File *file)
EINA_LIST_FREE(file->lines, l)
{
if (l->modified)
free(l->modified);
free(l);
elm_code_line_free(l);
}
if (file->parent)

View File

@ -6,6 +6,18 @@
#include "elm_code_private.h"
EAPI void
elm_code_line_free(Elm_Code_Line *line)
{
if (!line)
return;
if (line->modified)
free(line->modified);
free(line);
}
EAPI unsigned int
elm_code_line_utf8_length_get(Elm_Code_Line *line)
{

View File

@ -34,6 +34,8 @@ typedef struct _Elm_Code_Line
void *data;
} Elm_Code_Line;
EAPI void elm_code_line_free(Elm_Code_Line *line);
EAPI unsigned int elm_code_line_utf8_length_get(Elm_Code_Line *line);
/**