Metaswitch/sprout — pull request #238 by mirw (2013-10-03 17:30:23+00:00)
Title: [Reviewer: Alex] Fix AsChain scribbler

Alex,

Please can you review my fix to NULL out the reference to the AsChain when we release it. Without this fix, we can

* initialize the AsChainLink with an AsChain when we start originating processing
* release the AsChainLink (decrementing the AsChain's reference count) when we complete originating processing and start terminating processing
* **not** overwrite the AsChainLink if this is an outgoing call - normally, it would be overwritten by the terminating AsChain
* release the AsChainLink a second time in the UASTransaction destructor
* scribble because this decrements the AsChain's reference count a second time, but the AsChain has already been destroyed.

I've run the UT and confirmed that this fixes the failing live test.

Matt