mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-26 14:13:18 -05:00
Properly deinit DAAP sessions
Call event_del() before freeing the session when clearing the AVL tree. Caused an infinite loop in event_base_free() in httpd_deinit().
This commit is contained in:
parent
f6a9e1f7f4
commit
25ee24d2be
@ -526,11 +526,20 @@ daap_session_compare(const void *aa, const void *bb)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
daap_session_free(void *item)
|
||||
{
|
||||
struct daap_session *s;
|
||||
|
||||
s = (struct daap_session *)item;
|
||||
|
||||
evtimer_del(&s->timeout);
|
||||
free(s);
|
||||
}
|
||||
|
||||
static void
|
||||
daap_session_kill(struct daap_session *s)
|
||||
{
|
||||
evtimer_del(&s->timeout);
|
||||
|
||||
avl_delete(daap_sessions, s);
|
||||
}
|
||||
|
||||
@ -2801,7 +2810,7 @@ daap_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
daap_sessions = avl_alloc_tree(daap_session_compare, free);
|
||||
daap_sessions = avl_alloc_tree(daap_session_compare, daap_session_free);
|
||||
if (!daap_sessions)
|
||||
{
|
||||
DPRINTF(E_FATAL, L_DAAP, "DAAP init could not allocate DAAP sessions AVL tree\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user