Clean shutdown of resources on disconnect
Merge pull request #14 from garciafl/ShutdownOnDisconnect

Clean shutdown of resources on disconnect