Add avdtp ref when disconnect timer is active 98/268598/1
authorAyush Garg <ayush.garg@samsung.com>
Mon, 27 Dec 2021 10:28:08 +0000 (15:58 +0530)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 27 Dec 2021 10:41:12 +0000 (16:11 +0530)
This will be unref either at disconnect_timeout
or remove_disconnect_timer.

Change-Id: I3638ba446200f6c4d82e5f0923c9086f3519c283
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
profiles/audio/avdtp.c

index 5ae4501..26401f8 100644 (file)
@@ -1568,6 +1568,9 @@ static void set_disconnect_timer_for_sink(struct avdtp *session, gboolean discon
        if (session->dc_timer)
                remove_disconnect_timer(session);
 
+       /* Take a ref while disconnect timer is active */
+       avdtp_ref(session);
+
        device_get_name(session->device, name, sizeof(name));
        DBG("name : [%s]", name);
        if (g_str_equal(name, "VW BT") || g_str_equal(name, "VW MI") ||