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-view.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-view.c')
-rw-r--r-- | libyelp/yelp-view.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libyelp/yelp-view.c b/libyelp/yelp-view.c index 0e0d1d3f..c4432217 100644 --- a/libyelp/yelp-view.c +++ b/libyelp/yelp-view.c @@ -787,7 +787,6 @@ document_callback (YelpDocument *document, stream, content_length, mime_type); - request_async_data_free (data); g_free (mime_type); g_object_unref (stream); } @@ -810,7 +809,8 @@ help_cb_uri_resolved (YelpUri *uri, data->page_id, NULL, (YelpDocumentCallback) document_callback, - data); + data, + (GDestroyNotify) request_async_data_free); g_object_unref (document); } else { |