Alternatives to doing this would be to right click and then hit the close button or to use the hotkey for it (defaults to ctrl + w)