diff options
author | Christian Hergert <chergert@redhat.com> | 2017-02-07 18:55:01 -0800 |
---|---|---|
committer | Christian Hergert <chergert@redhat.com> | 2017-02-07 18:57:47 -0800 |
commit | 7d8ee5a1478a00af3e14fd8c563b7ae271723e79 (patch) | |
tree | a8fbfed6085862f28f533cde0817d6c73c39dc6c /libyelp/yelp-man-document.c | |
parent | 9dd95badfabe079291d01512319650cef0c9e619 (diff) | |
download | yelp-7d8ee5a1478a00af3e14fd8c563b7ae271723e79.tar.gz |
document: add destroy notify to page callback
This ensures that we only free the async data struct when the document is
guaranteed to be done calling our callback. Without this, we risk
potentially accessing the async request data after we have freed it
when a mallard document reloads.
https://bugzilla.gnome.org/show_bug.cgi?id=778258
Diffstat (limited to 'libyelp/yelp-man-document.c')
-rw-r--r-- | libyelp/yelp-man-document.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libyelp/yelp-man-document.c b/libyelp/yelp-man-document.c index 77e74143..4e165d57 100644 --- a/libyelp/yelp-man-document.c +++ b/libyelp/yelp-man-document.c @@ -124,7 +124,8 @@ static gboolean man_request_page (YelpDocument const gchar *page_id, GCancellable *cancellable, YelpDocumentCallback callback, - gpointer user_data); + gpointer user_data, + GDestroyNotify notify); /* YelpTransform */ static void transform_chunk_ready (YelpTransform *transform, @@ -203,7 +204,8 @@ man_request_page (YelpDocument *document, const gchar *page_id, GCancellable *cancellable, YelpDocumentCallback callback, - gpointer user_data) + gpointer user_data, + GDestroyNotify notify) { YelpManDocumentPrivate *priv = GET_PRIV (document); gchar *docuri, *fulluri; @@ -222,7 +224,8 @@ man_request_page (YelpDocument *document, page_id, cancellable, callback, - user_data); + user_data, + notify); if (handled) { return handled; } |