01org/dleyna-renderer — pull request #103 by markdryan (2013-07-23 11:53:13+00:00)
Title: [Introspection] Fixed bug 97

The fix is nasty but I can't see any other way to fix the issue
without having to change dleyna-core and GUPnP. This will have
to be done anyway at some point but in the meantime this is a
serious bug that needs to be patched ASAP.

The fix works as follows:

1. We use a weak refererence to detect if we have lost our renderer
during a call to gupnp_service_info_get_introspection. If we have
we return control direcly to the main loop failing any task and
making sure we do not access the device object.

2. We make sure that gupnp_service_info_get_introspection is not called
inside an event callback from GUPnP. Otherwise changes to the list of
devices in our callback can result in a crash when we return control back
to GUPnP.

Long term we need to retrieve introspection information asynchronously
during device construction and not during calls to GetProp or in
event handlers. We might has well initialise the properties during
device construction as well. This will simplify the code. Before
this can be done however, we need a way to cancel
gupnp_service_info_get_introspection_async and a way to call this
function inside a task queue.

Signed-off-by: Mark Ryan