GTK: make sure to delete any remaining dialogs when the SelectFileDialogImpl object goes out of scope.

The control flow was as follows:

1. user initiates a save page command
2. user initiates a second save page command
3. tab contents creates a SavePackage, shows dialog
4. tab contents gets second OnSavePage, deletes old SavePackage, which deletes its SelectFileDialogImpl
5. At this point two dialogs are visible.
6. User dismisses second dialog.
7. User dismisses first dialog, and calls us back with pointer to freed SelectFileDialogImpl.
8. Bad stuff.

BUG=23817
TEST=I put a sleep in Browser::SavePage, then hit ctrl+s twice quickly. Only one dialog appeared.

Review URL: http://codereview.chromium.org/243117

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28213 0039d316-1c4b-4281-b951-d872f2087c98
1 file changed