forked from enlightenment/enlightenment
fix possible crash when freeing pulse sinks
SVN revision: 64648
This commit is contained in:
parent
d4c9dceed4
commit
c960c47c58
|
@ -459,6 +459,7 @@ struct Pulse_Sink {
|
||||||
Eina_Bool mute : 1; /**< Mute switch of the sink */
|
Eina_Bool mute : 1; /**< Mute switch of the sink */
|
||||||
Eina_Bool update : 1;
|
Eina_Bool update : 1;
|
||||||
Eina_Bool source : 1; /**< sink is actually a source */
|
Eina_Bool source : 1; /**< sink is actually a source */
|
||||||
|
Eina_Bool deleted : 1; /**< sink has been deleted */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef uint32_t pa_pstream_descriptor[PA_PSTREAM_DESCRIPTOR_MAX];
|
typedef uint32_t pa_pstream_descriptor[PA_PSTREAM_DESCRIPTOR_MAX];
|
||||||
|
|
|
@ -164,16 +164,20 @@ pulse_sink_free(Pulse_Sink *sink)
|
||||||
{
|
{
|
||||||
Pulse_Sink_Port_Info *pi;
|
Pulse_Sink_Port_Info *pi;
|
||||||
if (!sink) return;
|
if (!sink) return;
|
||||||
|
if (!sink->deleted)
|
||||||
|
{
|
||||||
|
sink->deleted = EINA_TRUE;
|
||||||
if (sink->source)
|
if (sink->source)
|
||||||
{
|
{
|
||||||
if (eina_hash_del_by_key(pulse_sources, (uintptr_t*)&sink->index))
|
eina_hash_del_by_key(pulse_sources, (uintptr_t*)&sink->index);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (eina_hash_del_by_key(pulse_sinks, (uintptr_t*)&sink->index))
|
eina_hash_del_by_key(pulse_sinks, (uintptr_t*)&sink->index);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
eina_stringshare_del(sink->name);
|
eina_stringshare_del(sink->name);
|
||||||
eina_stringshare_del(sink->description);
|
eina_stringshare_del(sink->description);
|
||||||
EINA_LIST_FREE(sink->ports, pi)
|
EINA_LIST_FREE(sink->ports, pi)
|
||||||
|
|
Loading…
Reference in New Issue