Diff between 7b69385b5fcd3ed09782fffffc8b5dd1ff5dc746 and 134933c2861fca324f455a50afa16a3e120c898f

Changed Files

File Additions Deletions Status
audio/media.c +2 -2 modified

Full Patch

diff --git a/audio/media.c b/audio/media.c
index b0ea4e9..e4a7684 100644
--- a/audio/media.c
+++ b/audio/media.c
@@ -454,6 +454,8 @@ static void release_endpoint(struct media_endpoint *endpoint)
 	if (endpoint->watch == 0)
 		goto done;
 
+	clear_endpoint(endpoint);
+
 	msg = dbus_message_new_method_call(endpoint->sender, endpoint->path,
 						MEDIA_ENDPOINT_INTERFACE,
 						"Release");
@@ -615,8 +617,6 @@ static void a2dp_destroy_endpoint(void *user_data)
 {
 	struct media_endpoint *endpoint = user_data;
 
-	clear_endpoint(endpoint);
-
 	endpoint->sep = NULL;
 	release_endpoint(endpoint);
 }