I added a RWMutex to track if the IRC client object is currently connected. On connect and disconnect a write-lock is set which forbids any access to the client for the other parts of CptHook. The parts which access the client just use read-locks so they don't interfere which each other, but get blocked if a write-lock is currently in place.
This should fix #20 and #36 which are both resulting from the fact that CptHook tries to do stuff with the client while it is disconnected.
I added a RWMutex to track if the IRC client object is currently connected. On connect and disconnect a write-lock is set which forbids any access to the client for the other parts of CptHook. The parts which access the client just use read-locks so they don't interfere which each other, but get blocked if a write-lock is currently in place.
This should fix #20 and #36 which are both resulting from the fact that CptHook tries to do stuff with the client while it is disconnected.