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-simple-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-simple-document.c')
-rw-r--r-- | libyelp/yelp-simple-document.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libyelp/yelp-simple-document.c b/libyelp/yelp-simple-document.c index 47145621..501d7881 100644 --- a/libyelp/yelp-simple-document.c +++ b/libyelp/yelp-simple-document.c @@ -66,7 +66,8 @@ static gboolean document_request_page (YelpDocument const gchar *page_id, GCancellable *cancellable, YelpDocumentCallback callback, - gpointer user_data); + gpointer user_data, + GDestroyNotify notify); static const gchar * document_read_contents (YelpDocument *document, const gchar *page_id); static void document_finish_read (YelpDocument *document, @@ -181,7 +182,8 @@ document_request_page (YelpDocument *document, const gchar *page_id, GCancellable *cancellable, YelpDocumentCallback callback, - gpointer user_data) + gpointer user_data, + GDestroyNotify notify) { YelpSimpleDocument *simple = YELP_SIMPLE_DOCUMENT (document); Request *request; |