So the crash was from freeing the list of Connection objects, and it was most likely caused by some kind of memory scribble.
The only thing I can see wrong in that code is that it assumes the to-be-dealloc'd Connection object appears in the list. However, it ought to.
Anyway, I can harden that (to protect against e.g. bit-errors) by only removing the object from the list if it appears there in the first place. Hopefully that will prevent this kind of problem.
So the crash was from freeing the list of Connection objects, and it was most likely caused by some kind of memory scribble.
The only thing I can see wrong in that code is that it assumes the to-be-dealloc'd Connection object appears in the list. However, it ought to.
Anyway, I can harden that (to protect against e.g. bit-errors) by only removing the object from the list if it appears there in the first place. Hopefully that will prevent this kind of problem.