forked from enlightenment/efl
[elm_code] don't double free standard parsers
This commit is contained in:
parent
828bfb4d27
commit
b1cc9c7876
|
@ -95,7 +95,7 @@ elm_code_free(Elm_Code *code)
|
||||||
|
|
||||||
EINA_LIST_FREE(code->parsers, parser)
|
EINA_LIST_FREE(code->parsers, parser)
|
||||||
{
|
{
|
||||||
free(parser);
|
_elm_code_parser_free(parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(code);
|
free(code);
|
||||||
|
|
|
@ -13,6 +13,7 @@ struct _Elm_Code_Parser
|
||||||
void (*parse_file)(Elm_Code_File *, void *);
|
void (*parse_file)(Elm_Code_File *, void *);
|
||||||
|
|
||||||
void *data;
|
void *data;
|
||||||
|
Eina_Bool standard;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,6 +70,7 @@ _elm_code_parser_new(void (*parse_line)(Elm_Code_Line *, void *),
|
||||||
|
|
||||||
parser->parse_line = parse_line;
|
parser->parse_line = parse_line;
|
||||||
parser->parse_file = parse_file;
|
parser->parse_file = parse_file;
|
||||||
|
parser->standard = EINA_FALSE;
|
||||||
|
|
||||||
return parser;
|
return parser;
|
||||||
}
|
}
|
||||||
|
@ -95,6 +97,7 @@ elm_code_parser_standard_add(Elm_Code *code, Elm_Code_Parser *parser)
|
||||||
if (!parser || !code)
|
if (!parser || !code)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
parser->standard = EINA_TRUE;
|
||||||
code->parsers = eina_list_append(code->parsers, parser);
|
code->parsers = eina_list_append(code->parsers, parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,6 +188,15 @@ _elm_code_parser_todo_parse_line(Elm_Code_Line *line, void *data EINA_UNUSED)
|
||||||
elm_code_line_status_set(line, ELM_CODE_STATUS_TYPE_TODO);
|
elm_code_line_status_set(line, ELM_CODE_STATUS_TYPE_TODO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_elm_code_parser_free(Elm_Code_Parser *parser)
|
||||||
|
{
|
||||||
|
if (parser->standard)
|
||||||
|
return;
|
||||||
|
|
||||||
|
free(parser);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_elm_code_parse_setup()
|
_elm_code_parse_setup()
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,5 +34,6 @@ void _elm_code_parse_file(Elm_Code *code, Elm_Code_File *file);
|
||||||
|
|
||||||
void _elm_code_parse_reset_file(Elm_Code *code, Elm_Code_File *file);
|
void _elm_code_parse_reset_file(Elm_Code *code, Elm_Code_File *file);
|
||||||
|
|
||||||
|
void _elm_code_parser_free(Elm_Code_Parser *parser);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue