Why should I call dismiss() method for AlertDialog before Activity is destroyed? Something leaks, but what exactly? Why then PopupWindow can handle Activity destroying?
I've found in Android sources that each alert dialog creates window:
Window w = PolicyManager.makeNewWindow(mContext);
What does that mean? Why it cannot just use PhoneWindow obtained from activity?
ADDED
Say, AlertDialog references Context, Context references nothing, then GC should garbage collect both objects (as they are not referenced from 'outside'). What else has a reference to AlertDialog? In other words where is exactly memory leak?