mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-27 06:33:21 -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;
|
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
|
static void
|
||||||
daap_session_kill(struct daap_session *s)
|
daap_session_kill(struct daap_session *s)
|
||||||
{
|
{
|
||||||
evtimer_del(&s->timeout);
|
|
||||||
|
|
||||||
avl_delete(daap_sessions, s);
|
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)
|
if (!daap_sessions)
|
||||||
{
|
{
|
||||||
DPRINTF(E_FATAL, L_DAAP, "DAAP init could not allocate DAAP sessions AVL tree\n");
|
DPRINTF(E_FATAL, L_DAAP, "DAAP init could not allocate DAAP sessions AVL tree\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user