forked from enlightenment/efl
Eolian: Valgrind cleaning
This commit is contained in:
parent
21533a0079
commit
2db3cdb5e3
|
@ -101,13 +101,15 @@ _startline(char *str, char *pos)
|
|||
char*
|
||||
_first_line_get(const char *str)
|
||||
{
|
||||
Eina_Strbuf *ret = eina_strbuf_new();
|
||||
Eina_Strbuf *buf = eina_strbuf_new();
|
||||
if (str)
|
||||
{
|
||||
const char *p = strchr(str, '\n');
|
||||
size_t offs = (p) ? (size_t)(p - str) : strlen(str);
|
||||
eina_strbuf_append_n(ret, str, offs);
|
||||
eina_strbuf_append_n(buf, str, offs);
|
||||
}
|
||||
return eina_strbuf_string_steal(ret);
|
||||
char *ret = eina_strbuf_string_steal(buf);
|
||||
eina_strbuf_free(buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "eo_definitions.h"
|
||||
|
||||
void
|
||||
static void
|
||||
eo_definitions_ret_free(Eo_Ret_Def *ret)
|
||||
{
|
||||
if (ret->type) eina_stringshare_del(ret->type);
|
||||
|
@ -11,7 +11,7 @@ eo_definitions_ret_free(Eo_Ret_Def *ret)
|
|||
/* do not free */
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
eo_definitions_param_free(Eo_Param_Def *param)
|
||||
{
|
||||
if (param->type) eina_stringshare_del(param->type);
|
||||
|
@ -20,7 +20,15 @@ eo_definitions_param_free(Eo_Param_Def *param)
|
|||
free(param);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
eo_definitions_accessor_param_free(Eo_Accessor_Param *param)
|
||||
{
|
||||
if (param->name) eina_stringshare_del(param->name);
|
||||
if (param->attrs) eina_stringshare_del(param->attrs);
|
||||
free(param);
|
||||
}
|
||||
|
||||
static void
|
||||
eo_definitions_accessor_free(Eo_Accessor_Def *accessor)
|
||||
{
|
||||
if (accessor->comment)
|
||||
|
@ -29,12 +37,16 @@ eo_definitions_accessor_free(Eo_Accessor_Def *accessor)
|
|||
if (accessor->legacy)
|
||||
eina_stringshare_del(accessor->legacy);
|
||||
|
||||
Eo_Accessor_Param *param;
|
||||
EINA_LIST_FREE(accessor->params, param)
|
||||
eo_definitions_accessor_param_free(param);
|
||||
|
||||
eo_definitions_ret_free(&accessor->ret);
|
||||
|
||||
free(accessor);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
eo_definitions_property_def_free(Eo_Property_Def *prop)
|
||||
{
|
||||
Eo_Param_Def *param;
|
||||
|
@ -55,7 +67,7 @@ eo_definitions_property_def_free(Eo_Property_Def *prop)
|
|||
free(prop);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
eo_definitions_method_def_free(Eo_Method_Def *meth)
|
||||
{
|
||||
Eo_Param_Def *param;
|
||||
|
@ -75,7 +87,7 @@ eo_definitions_method_def_free(Eo_Method_Def *meth)
|
|||
free(meth);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
eo_definitions_event_def_free(Eo_Event_Def *sgn)
|
||||
{
|
||||
if (sgn->name)
|
||||
|
@ -86,7 +98,7 @@ eo_definitions_event_def_free(Eo_Event_Def *sgn)
|
|||
free(sgn);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
eo_definitions_impl_def_free(Eo_Implement_Def *impl)
|
||||
{
|
||||
if (impl->meth_name)
|
||||
|
|
|
@ -132,19 +132,6 @@ typedef struct _eo_class_def
|
|||
Eina_List *methods;
|
||||
} Eo_Class_Def;
|
||||
|
||||
void eo_definitions_ret_free(Eo_Ret_Def *ret);
|
||||
|
||||
void eo_definitions_param_free(Eo_Param_Def *param);
|
||||
|
||||
void eo_definitions_accessor_free(Eo_Accessor_Def *accessor);
|
||||
|
||||
void eo_definitions_property_def_free(Eo_Property_Def *prop);
|
||||
|
||||
void eo_definitions_method_def_free(Eo_Method_Def *prop);
|
||||
|
||||
void eo_definitions_class_def_free(Eo_Class_Def *kls);
|
||||
|
||||
void eo_definitions_event_def_free(Eo_Event_Def *sgn);
|
||||
|
||||
void eo_definitions_impl_def_free(Eo_Implement_Def *impl);
|
||||
#endif /* __EO_DEFINITIONS_H__ */
|
||||
|
|
|
@ -2689,7 +2689,6 @@ eo_tokenizer_database_fill(const char *filename)
|
|||
Eo_Implement_Def *impl;
|
||||
/* Eo_Ret_Def *ret; */
|
||||
|
||||
INF("Parsing %s", filename);
|
||||
Eo_Tokenizer *toknz = eo_tokenizer_get();
|
||||
if (!toknz)
|
||||
{
|
||||
|
|
|
@ -57,6 +57,7 @@ EAPI int eolian_shutdown(void)
|
|||
|
||||
EAPI Eina_Bool eolian_eo_file_parse(const char *filename)
|
||||
{
|
||||
if (eolian_class_find_by_file(filename)) return EINA_TRUE;
|
||||
return eo_tokenizer_database_fill(filename);
|
||||
}
|
||||
|
||||
|
|
|
@ -86,8 +86,10 @@ static void
|
|||
_fid_del(_Function_Id *fid)
|
||||
{
|
||||
_Parameter_Desc *param;
|
||||
if (!fid) return;
|
||||
eina_stringshare_del(fid->name);
|
||||
eina_hash_free(fid->data);
|
||||
EINA_LIST_FREE(fid->keys, param) _param_del(param);
|
||||
EINA_LIST_FREE(fid->params, param) _param_del(param);
|
||||
free(fid);
|
||||
}
|
||||
|
@ -100,12 +102,24 @@ _class_del(Class_desc *class)
|
|||
EINA_LIST_FREE(inherits, inherit_name)
|
||||
eina_stringshare_del(inherit_name);
|
||||
|
||||
_Implement_Desc *impl;
|
||||
Eina_List *implements = class->implements;
|
||||
EINA_LIST_FREE(implements, impl)
|
||||
{
|
||||
eina_stringshare_del(impl->class_name);
|
||||
eina_stringshare_del(impl->func_name);
|
||||
free(impl);
|
||||
}
|
||||
|
||||
_Function_Id *fid;
|
||||
Eolian_Event ev;
|
||||
EINA_LIST_FREE(class->constructors, fid) _fid_del(fid);
|
||||
EINA_LIST_FREE(class->destructors, fid) _fid_del(fid);
|
||||
EINA_LIST_FREE(class->methods, fid) _fid_del(fid);
|
||||
EINA_LIST_FREE(class->properties, fid) _fid_del(fid);
|
||||
EINA_LIST_FREE(class->events, ev) database_event_free(ev);
|
||||
_fid_del((_Function_Id *)class->dflt_ctor);
|
||||
_fid_del((_Function_Id *)class->dflt_dtor);
|
||||
|
||||
eina_stringshare_del(class->name);
|
||||
eina_stringshare_del(class->file);
|
||||
|
|
Loading…
Reference in New Issue