예제 #1
0
static void
gabble_im_factory_close_all (GabbleImFactory *self)
{
  /* Use a temporary variable (the macro does this) because we don't want
   * im_channel_closed_cb to remove the channel from the hash table a
   * second time */
  tp_clear_pointer (&self->priv->channels, g_hash_table_unref);

  if (self->priv->status_changed_id != 0)
    {
      g_signal_handler_disconnect (self->priv->conn,
          self->priv->status_changed_id);
      self->priv->status_changed_id = 0;
    }

  if (self->priv->message_cb_id != 0)
    {
      WockyPorter *porter = gabble_connection_dup_porter (self->priv->conn);

      wocky_porter_unregister_handler (porter, self->priv->message_cb_id);
      self->priv->message_cb_id = 0;

      wocky_porter_unregister_handler (porter, self->priv->delivery_report_cb_id);
      self->priv->delivery_report_cb_id = 0;

      g_object_unref (porter);
    }
}
예제 #2
0
static void
gabble_jingle_info_dispose (GObject *object)
{
  GabbleJingleInfo *self = GABBLE_JINGLE_INFO (object);
  GabbleJingleInfoPrivate *priv = self->priv;
  GObjectClass *parent_class = gabble_jingle_info_parent_class;

  if (priv->porter != NULL)
    {
      g_assert (priv->jingle_info_handler_id != 0);
      wocky_porter_unregister_handler (priv->porter, priv->jingle_info_handler_id);
      g_clear_object (&priv->porter);
    }

  if (priv->google_resolver != NULL)
    {
      gabble_google_relay_resolver_destroy (priv->google_resolver);
      priv->google_resolver = NULL;
    }

  g_free (priv->stun_server);
  priv->stun_server = NULL;
  g_free (priv->fallback_stun_server);
  priv->fallback_stun_server = NULL;
  g_free (priv->relay_token);
  priv->relay_token = NULL;
  g_free (priv->relay_server);
  priv->relay_server = NULL;

  if (parent_class->dispose != NULL)
    parent_class->dispose (object);
}
static void
gibber_file_transfer_dispose (GObject *object)
{
  GibberFileTransfer *self = GIBBER_FILE_TRANSFER (object);

  if (self->priv->porter != NULL)
    {
      wocky_porter_unregister_handler (self->priv->porter,
          self->priv->stanza_id);
      g_object_unref (self->priv->porter);
      self->priv->porter = NULL;
    }

  if (self->priv->contact != NULL)
    {
      g_object_unref (self->priv->contact);
      self->priv->contact = NULL;
    }

  if (self->dataforms)
    {
      g_list_foreach (self->dataforms, (GFunc) g_object_unref, NULL);
      g_list_free (self->dataforms);
      self->dataforms = NULL;
    }

  G_OBJECT_CLASS (gibber_file_transfer_parent_class)->dispose (object);
}
예제 #4
0
void
gabble_jingle_factory_stop (GabbleJingleFactory *self)
{
  GabbleJingleFactoryPrivate *priv = self->priv;

  if (priv->porter != NULL &&
      priv->jingle_handler_id != 0)
    {
      wocky_porter_unregister_handler (priv->porter, priv->jingle_handler_id);
      priv->jingle_handler_id = 0;
    }
}