summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-11-14 12:33:52 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-11-14 12:33:52 +0000
commite544cd5ffbbe663f56aaf08d1247bdea80e6eaea (patch)
treea6f773de5fbf1a7f7428833ff505880605f32fe7
parent0d05b8960e50187014a0423b151d23526a8d4b26 (diff)
ensure pulse mixer always disconnects when requested
SVN revision: 79292
-rw-r--r--pa.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pa.c b/pa.c
index 924a9e9..27c0dbc 100644
--- a/pa.c
+++ b/pa.c
@@ -749,8 +749,9 @@ pulse_connect(Pulse *conn)
749void 749void
750pulse_disconnect(Pulse *conn) 750pulse_disconnect(Pulse *conn)
751{ 751{
752 Eina_Bool event = EINA_FALSE;
752 EINA_SAFETY_ON_NULL_RETURN(conn); 753 EINA_SAFETY_ON_NULL_RETURN(conn);
753 if (conn->state == PA_STATE_INIT) return; 754
754 conn->state = PA_STATE_INIT; 755 conn->state = PA_STATE_INIT;
755 if (conn->fdh) 756 if (conn->fdh)
756 { 757 {
@@ -758,13 +759,16 @@ pulse_disconnect(Pulse *conn)
758 conn->fdh = NULL; 759 conn->fdh = NULL;
759 close(conn->fd); 760 close(conn->fd);
760 conn->fd = -1; 761 conn->fd = -1;
762 event = EINA_TRUE;
761 } 763 }
762 else if (conn->svr) 764 else if (conn->svr)
763 { 765 {
764 ecore_con_server_del(conn->svr); 766 ecore_con_server_del(conn->svr);
765 conn->svr = NULL; 767 conn->svr = NULL;
768 event = EINA_TRUE;
766 } 769 }
767 ecore_event_add(PULSE_EVENT_DISCONNECTED, conn, pulse_fake_free, NULL); 770 if (event)
771 ecore_event_add(PULSE_EVENT_DISCONNECTED, conn, pulse_fake_free, NULL);
768} 772}
769 773
770void 774void