Sunday, December 4, 2016

AbiathRPC - Make sure the connection gets closed

When a remote level set is closed, it's important that AbiathRPC clean up and realize that it's no longer supposed to be talking to that server. I already had an event handler on the Close menu item, but a level set can also be closed in the process of a new one opening, which bypasses that event handler. Fortunately, the level label is updated during the close process, so I added a check for the current level set being gone to the existing handler. If the main level set is missing, it initiates AbiathRPC disconnection, which cleans everything up.

No comments:

Post a Comment