How can I keep fruit flies out of my wine glass?

I live in Southern California and in the summer fruit flies appear in our house, but only in our wine. How can we keep them from diving in the glass?