gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r33449 - gnunet-gtk/src/conversation


From: gnunet
Subject: [GNUnet-SVN] r33449 - gnunet-gtk/src/conversation
Date: Sat, 31 May 2014 23:05:43 +0200

Author: grothoff
Date: 2014-05-31 23:05:43 +0200 (Sat, 31 May 2014)
New Revision: 33449

Modified:
   gnunet-gtk/src/conversation/gnunet-conversation-gtk_phone.c
Log:
expand clean-up logic

Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk_phone.c
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk_phone.c 2014-05-31 
21:00:13 UTC (rev 33448)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk_phone.c 2014-05-31 
21:05:43 UTC (rev 33449)
@@ -352,6 +352,44 @@
 
 
 /**
+ * Free data structure associated with an incoming call.
+ *
+ * @param ic incoming call to free
+ */
+static void
+destroy_in (struct IncomingCall *ic)
+{
+  if (NULL != ic->caller)
+  {
+    GNUNET_CONVERSATION_caller_hang_up (ic->caller);
+    ic->caller = NULL;
+  }
+  GNUNET_free (ic->caller_id);
+  gtk_tree_row_reference_free (ic->rr);
+  GNUNET_free (ic);
+}
+
+
+/**
+ * Free data structure associated with an outgoing call.
+ *
+ * @param oc outgoing call to free
+ */
+static void
+destroy_out (struct OutgoingCall *oc)
+{
+  if (NULL != oc->call)
+  {
+    GNUNET_CONVERSATION_call_stop (oc->call);
+    ic->caller = NULL;
+  }
+  GNUNET_free (oc->peer_name);
+  gtk_tree_row_reference_free (oc->rr);
+  GNUNET_free (oc);
+}
+
+
+/**
  * Update status based on current phone state.
  *
  * @param args arguments given to the command
@@ -1165,22 +1203,20 @@
 {
   if (NULL != active_in)
   {
-    GNUNET_CONVERSATION_caller_hang_up (active_in->caller);
-    // FIXME: memory leak
+    destroy_in (active_in);
     active_in = NULL;
   }
   if (NULL != active_out)
   {
-    GNUNET_CONVERSATION_call_stop (active_out->call);
-    // FIXME: memory leak
+    destroy_out (active_out);
     active_out = NULL;
   }
-  // FIXME: clean up tree view!
   if (NULL != phone)
   {
     GNUNET_CONVERSATION_phone_destroy (phone);
     phone = NULL;
   }
+  gtk_list_store_clear (active_liststore);
   GNUNET_SPEAKER_destroy (speaker);
   speaker = NULL;
   GNUNET_MICROPHONE_destroy (mic);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]