Hoary old chestnut

In a recent on-line discussion on another topic, the phrase "hoary old chestnut" was used. I've long held a notion as to the origin of this phrase, but I've no idea where it REALLY originated.

Does anyone have the "real" origin?

It comes from a play called "Broken Sword" by W Dimond, published in 1816. One character starts to tell a story and mentions a cork tree; another interrupts saying ""This is the twenty-seventh time I have heard you relate this story, and you invariably said, a chestnut, till now!" Thus "a chestnut" is a much-repeated story. The phrase is first recorded in this sense in 1880.