YelpMallardDocument frees xmlDocPtr while in threaded use
@chergert
Submitted by Christian Hergert Link to original bug (#778263)
Description
The YelpMallardDocument seems to track whether or not it is running in a thread, but does not track whether or not it's base class might be running in a thread with data found within the xmlDocPtr.
For example, yelp_transform_start() may have been called with contents from this doc and actively processing a stylesheet.
This results in priv->cache being freed in mallard_monitor_changed() while in use.
Simply commenting out the xmlFreeDoc() seems to improve things. (Although I have a lot of other local changes while trying to track this down, so others may also be responsible).
It's hard to love the design of these layers right now where everything is signaled instead of using async/finish pairs. The lifetime tracking of the structs has me in the twilight zone, and I would strongly encourage updating Yelp*Document and YelpTransform to use modern glib async/finish, autoptr, and some sort of reference-counted wrapper for the libxml2 pointers.
Version: git master