Bug 785744 - Async file picker cleanup. r=neil

This commit is contained in:
Brian R. Bondy
2012-08-29 14:37:43 -04:00
parent b7b5730eaf
commit dbcbda32d0
3 changed files with 19 additions and 17 deletions

View File

@@ -51,15 +51,16 @@ public:
// It's possible that some widget implementations require GUI operations
// to be on the main thread, so that's why we're not dispatching to another
// thread and calling back to the main after it's done.
int16_t result;
int16_t result = nsIFilePicker::returnCancel;
nsresult rv = mFilePicker->Show(&result);
if (NS_FAILED(rv)) {
NS_ERROR("FilePicker's Show() implementation failed!");
mCallback->Done(nsIFilePicker::returnCancel);
return NS_OK;
}
return mCallback->Done(result);
if (mCallback) {
mCallback->Done(result);
}
return NS_OK;
}
private: