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-docbook-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-docbook-document.c')
-rw-r--r-- | libyelp/yelp-docbook-document.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libyelp/yelp-docbook-document.c b/libyelp/yelp-docbook-document.c index 4ac09a97..9b430b09 100644 --- a/libyelp/yelp-docbook-document.c +++ b/libyelp/yelp-docbook-document.c @@ -60,7 +60,8 @@ static gboolean docbook_request_page (YelpDocument *document, const gchar *page_id, GCancellable *cancellable, YelpDocumentCallback callback, - gpointer user_data); + gpointer user_data, + GDestroyNotify notify); static void docbook_process (YelpDocbookDocument *docbook); static void docbook_disconnect (YelpDocbookDocument *docbook); @@ -239,7 +240,8 @@ docbook_request_page (YelpDocument *document, const gchar *page_id, GCancellable *cancellable, YelpDocumentCallback callback, - gpointer user_data) + gpointer user_data, + GDestroyNotify notify) { YelpDocbookDocumentPrivate *priv = GET_PRIV (document); gchar *docuri; @@ -257,7 +259,8 @@ docbook_request_page (YelpDocument *document, page_id, cancellable, callback, - user_data); + user_data, + notify); if (handled) { return handled; } |