take the wind out of the sails

Meaning 1
A sailing maneuver in which one boat gets between the wind and the opponent's sail, thereby slowing the boat's speed
Sentence 1
In the San Francisco America Cup matches the competing sailboats often took the wind out of their opponent's sails in order to reach a goal faster or to finish first.
Meaning 2
to thwart; discouragement
Sentence 2
Tom called my girl first and took the wind out of my sails.