summaryrefslogtreecommitdiff
path: root/libyelp/yelp-document.c
diff options
context:
space:
mode:
Diffstat (limited to 'libyelp/yelp-document.c')
-rw-r--r--libyelp/yelp-document.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/libyelp/yelp-document.c b/libyelp/yelp-document.c
index f26ebd2b..547ef24d 100644
--- a/libyelp/yelp-document.c
+++ b/libyelp/yelp-document.c
@@ -51,6 +51,7 @@ struct _Request {
GCancellable *cancellable;
YelpDocumentCallback callback;
gpointer user_data;
+ GDestroyNotify notify;
GError *error;
gint idle_funcs;
@@ -113,7 +114,8 @@ static gboolean document_request_page (YelpDocument *document,
const gchar *page_id,
GCancellable *cancellable,
YelpDocumentCallback callback,
- gpointer user_data);
+ gpointer user_data,
+ GDestroyNotify notify);
static gboolean document_indexed (YelpDocument *document);
static const gchar * document_read_contents (YelpDocument *document,
const gchar *page_id);
@@ -810,7 +812,8 @@ yelp_document_request_page (YelpDocument *document,
const gchar *page_id,
GCancellable *cancellable,
YelpDocumentCallback callback,
- gpointer user_data)
+ gpointer user_data,
+ GDestroyNotify notify)
{
g_return_val_if_fail (YELP_IS_DOCUMENT (document), FALSE);
g_return_val_if_fail (YELP_DOCUMENT_GET_CLASS (document)->request_page != NULL, FALSE);
@@ -821,7 +824,8 @@ yelp_document_request_page (YelpDocument *document,
page_id,
cancellable,
callback,
- user_data);
+ user_data,
+ notify);
}
static gboolean
@@ -829,7 +833,8 @@ document_request_page (YelpDocument *document,
const gchar *page_id,
GCancellable *cancellable,
YelpDocumentCallback callback,
- gpointer user_data)
+ gpointer user_data,
+ GDestroyNotify notify)
{
Request *request;
gchar *real_id;
@@ -855,6 +860,7 @@ document_request_page (YelpDocument *document,
request->callback = callback;
request->user_data = user_data;
+ request->notify = notify;
request->idle_funcs = 0;
g_mutex_lock (&document->priv->mutex);
@@ -1510,6 +1516,9 @@ request_try_free (Request *request)
static void
request_free (Request *request)
{
+ if (request->notify)
+ request->notify (request->user_data);
+
g_object_unref (request->document);
g_free (request->page_id);
g_object_unref (request->cancellable);