telepathy: fix crashes in error/shutdown cases
commit4e2f7587c53877b93f412fdee22fe49b512809af
authorStefan Becker <chemobejk@gmail.com>
Tue, 28 Aug 2012 22:05:53 +0000 (29 01:05 +0300)
committerStefan Becker <chemobejk@gmail.com>
Thu, 30 Aug 2012 19:04:32 +0000 (30 22:04 +0300)
treebc3847366e82f684fb7377c102c78e44c5614397
parent1e332ae86d9e28321347c8da1fead2c50b2a2ca3
telepathy: fix crashes in error/shutdown cases

Add a GCancellable to all async operations. When disconnecting the
transport we set the cancel flag and invalidate the error callback.
Check that error callback is valid in all async callbacks.

The same also applies to the DNS queries callback.

Storing the server transport pointer to the private backend data
structure is now done after the socket is connected. Before that we
shouldn't send any messages on shutdown.

Freeing the transport data structure also needs to be done
asynchronously, because only when we return to the main event loop the
cancellations & closing will be handled by GIO.

With these changes in place I have not been able to crash the CM anymore
with wild & random account enable & disable attempts.
src/telepathy/telepathy-dnsquery.c
src/telepathy/telepathy-transport.c