Bug 1846689 - Make IORunnable::mFilePickerParent into a RefPtr. r=mccr8, a=RyanVM

Differential Revision: https://phabricator.services.mozilla.com/D185820
This commit is contained in:
Vincent Hilla 2023-08-14 18:36:40 +00:00
parent 50ee8d7d35
commit 1decd8e08e
2 changed files with 3 additions and 2 deletions

View File

@ -274,6 +274,7 @@ mozilla::ipc::IPCResult FilePickerParent::RecvOpen(
mFilePicker->SetDisplaySpecialDirectory(aDisplaySpecialDirectory);
}
MOZ_ASSERT(!mCallback);
mCallback = new FilePickerShownCallback(this);
mFilePicker->Open(mCallback);

View File

@ -62,7 +62,7 @@ class FilePickerParent : public PFilePickerParent {
private:
virtual ~FilePickerShownCallback() = default;
FilePickerParent* mFilePickerParent;
RefPtr<FilePickerParent> mFilePickerParent;
};
private:
@ -70,7 +70,7 @@ class FilePickerParent : public PFilePickerParent {
// This runnable is used to do some I/O operation on a separate thread.
class IORunnable : public Runnable {
FilePickerParent* mFilePickerParent;
RefPtr<FilePickerParent> mFilePickerParent;
nsTArray<nsCOMPtr<nsIFile>> mFiles;
nsTArray<BlobImplOrString> mResults;
nsCOMPtr<nsIEventTarget> mEventTarget;