Closing the client disconnects you from the game server... if you remain logged out for at least five minutes, you will be signed out. If you log off you will be dropped from the instance.
If the client crashed, that's one thing. But intentionally restarting your computer during an instance... you have only yourself to blame.