Check if any TCanvases are open

Can I check if there are any TCanvas objects open?
How I terminate the program would depend on this.

gROOT->GetListOfCanvases()