No longer seg faults upon being exited.
Was caused due to the socket still being connected, which activated UI elements when the GUI was being closed.