SoupMessageQueueItem *item;
item = g_slice_new0 (SoupMessageQueueItem);
- item->session = queue->session;
+ item->session = g_object_ref (queue->session);
item->async_context = soup_session_get_async_context (item->session);
item->queue = queue;
item->msg = g_object_ref (msg);
/* And free it */
g_signal_handlers_disconnect_by_func (item->msg,
queue_message_restarted, item);
+ g_object_unref (item->session);
g_object_unref (item->msg);
g_object_unref (item->cancellable);
if (item->proxy_addr)
soup_message_queue_item_unref (item->related);
soup_session_unqueue_item (session, item);
soup_message_queue_item_unref (item);
- g_object_unref (session);
}
static void
soup_connection_disconnect (conn);
do_idle_run_queue (session);
soup_message_queue_item_unref (item);
- g_object_unref (session);
return;
}
do_idle_run_queue (session);
soup_message_queue_item_unref (item);
- g_object_unref (session);
return;
}
G_CALLBACK (connection_closed), session);
run_queue ((SoupSessionAsync *)session);
soup_message_queue_item_unref (item);
- g_object_unref (session);
}
static void
item->state = SOUP_MESSAGE_CONNECTING;
soup_message_queue_item_ref (item);
- g_object_ref (session);
soup_connection_connect_async (item->conn, item->cancellable,
got_connection, item);
return;
if (item->state != SOUP_MESSAGE_FINISHED)
break;
- g_object_ref (session);
+ soup_message_queue_item_ref (item);
soup_session_unqueue_item (session, item);
if (item->callback)
item->callback (session, item->msg, item->callback_data);
else if (item->new_api)
send_request_finished (session, item);
do_idle_run_queue (session);
- g_object_unref (session);
+ soup_message_queue_item_unref (item);
return;
default:
SoupMessageQueueItem *item = data;
item->callback (item->session, item->msg, item->callback_data);
- g_object_unref (item->session);
soup_message_queue_item_unref (item);
return FALSE;
}
if (item->callback) {
soup_add_completion (soup_session_get_async_context (item->session),
queue_message_callback, item);
- } else {
- g_object_unref (item->session);
+ } else
soup_message_queue_item_unref (item);
- }
return NULL;
}
SoupMessageQueueItem *item;
GThread *thread;
- g_object_ref (session);
item = soup_session_append_queue_item (session, msg, callback, user_data);
thread = g_thread_new ("SoupSessionSync:queue_message",
queue_message_thread, item);