mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-04-22 07:30:50 +00:00
fix double free when deleting fluid_seqbind_t
This commit is contained in:
parent
36546a9efb
commit
5f70eb8226
2 changed files with 0 additions and 14 deletions
|
@ -302,36 +302,23 @@ void
|
|||
fluid_sequencer_unregister_client (fluid_sequencer_t* seq, fluid_seq_id_t id)
|
||||
{
|
||||
fluid_list_t *tmp;
|
||||
fluid_event_t* evt;
|
||||
|
||||
if (seq->clients == NULL) return;
|
||||
|
||||
evt = new_fluid_event();
|
||||
if (evt != NULL) {
|
||||
fluid_event_unregistering(evt);
|
||||
fluid_event_set_dest(evt, id);
|
||||
}
|
||||
|
||||
tmp = seq->clients;
|
||||
while (tmp) {
|
||||
fluid_sequencer_client_t *client = (fluid_sequencer_client_t*)tmp->data;
|
||||
|
||||
if (client->id == id) {
|
||||
/* What should we really do if evt is null due to out-of-memory? */
|
||||
if (client->callback != NULL && evt != NULL)
|
||||
(client->callback)(fluid_sequencer_get_tick(seq),
|
||||
evt, seq, client->data);
|
||||
if (client->name)
|
||||
FLUID_FREE(client->name);
|
||||
seq->clients = fluid_list_remove_link(seq->clients, tmp);
|
||||
delete1_fluid_list(tmp);
|
||||
FLUID_FREE(client);
|
||||
delete_fluid_event(evt);
|
||||
return;
|
||||
}
|
||||
tmp = tmp->next;
|
||||
}
|
||||
delete_fluid_event(evt);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -230,7 +230,6 @@ fluid_seq_fluidsynth_callback(unsigned int time, fluid_event_t* evt, fluid_seque
|
|||
break;
|
||||
|
||||
case FLUID_SEQ_UNREGISTERING: /* free ourselves */
|
||||
seqbind->client_id = -1; /* avoid recursive call to fluid_sequencer_unregister_client */
|
||||
delete_fluid_seqbind(seqbind);
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in a new issue