Metaswitch/sprout — pull request #494 by rkd-msw (2014-04-09 13:43:12+00:00)
Title: [Reviewer: Mike] Move cwtest_reset_time() into BaseTest to avoid a gap between HttpConnec...

...tionTest deleting the LVC and something else still using it

I had a think about the Valgrind invalid read error - I think it could be due to the fact that we're now deleting the LVC slightly earlier (in the HttpConnectionTest destructor rather than the BaseTest destructor). This is to avoid an ordering issue between destroying that and calling cwtest_reset_time() to move time backwards (if you move time backwards first, ZeroMQ might pause for ages waiting for a timeout).

This speculative fix does things in the opposite order - it moves cwtest_reset_time() into ~BaseTest, so that the ordering is still correct and we're still deleting the LVC at the same time.