fix memory issue
we assigned NULL to a entry that was preexisting
This commit is contained in:
parent
41da42207d
commit
d6759ca3ea
|
@ -32,7 +32,6 @@ _timed_del(void *data)
|
||||||
{
|
{
|
||||||
Entry *e = data;
|
Entry *e = data;
|
||||||
_del_key(e->name);
|
_del_key(e->name);
|
||||||
e->timer = NULL;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,16 +103,17 @@ _del_key(const char *name)
|
||||||
//deref the entry
|
//deref the entry
|
||||||
e->ref --;
|
e->ref --;
|
||||||
|
|
||||||
|
if (e->timer) ecore_timer_del(e->timer);
|
||||||
|
|
||||||
if (e->ref == 1)
|
if (e->ref == 1)
|
||||||
{
|
{
|
||||||
if (e->timer) ecore_timer_del(e->timer);
|
|
||||||
e->timer = ecore_timer_add(0.5, _timed_del, e);
|
e->timer = ecore_timer_add(0.5, _timed_del, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
//free if null
|
//free if null
|
||||||
if (e->ref == 0)
|
if (e->ref == 0)
|
||||||
{
|
{
|
||||||
|
e->timer = NULL;
|
||||||
//if ref is 0 nuke out that entry
|
//if ref is 0 nuke out that entry
|
||||||
eina_hash_del_by_key(string_hash, name);
|
eina_hash_del_by_key(string_hash, name);
|
||||||
//we need to update the notify visuals depending on the state of the box
|
//we need to update the notify visuals depending on the state of the box
|
||||||
|
|
Loading…
Reference in New Issue