If I call class member function Disconnect() inside another my custom class member function – program hangs up. If I call the same function in main function: robot-> Disconnect(), it work fine.