Add unregister() method.
Unregister everything at closing.
Don't call close() in __del__, rely on explicit call to close().
1 file changed