ipop-project/ipop-tincan — pull request #45 by kangjianbin (2014-03-09 13:56:54+00:00)
Title: Fix memory leak in DestroyTransport.

Transport (and channels) depends on port_allocator, so we need delete
transport before deleting port_allocator.
The order of members in PeerState make default destructor to delete
port_allocator first, that may crash program in some situation.

========================================
I tried on my machine for several times.
But it is hard to trigger the crash even without this commit.

I push this request so we can have more people to test it.