In the books, Harry's glasses are constantly being broken or damaged. The most memorable instance is in "Harry Potter and the Chamber of Secrets" when they are broken by Draco Malfoy. However, Harry never gets them fixed with magic.
It's possible you are thinking of a scene from the movies. The movies sometimes take liberties with the source material.