Python doesn't exit after main function

I put in an IPython.embed() before the function return and poked around. Apparently I needed to manually .Close() some ROOT.TFiles and some ROOT.TCanvases that I had put into python lists. After manually removing them (in the script), the function returns fine and python quits. Is this some problem in the ROOT memory management? I thought I didn’t have to Close/Delete any objects if I didn’t explicitly take ownership of them.

Jean-Françoi