[DOM] Make IORunnable::mFilePickerParent into a RefPtr.

This commit is contained in:
Moonchild 2023-08-30 19:30:17 +02:00 committed by roytam1
commit 0359d8a9e7
2 changed files with 3 additions and 2 deletions

View file

@ -286,6 +286,7 @@ FilePickerParent::RecvOpen(const int16_t& aSelectedType,
}
}
MOZ_ASSERT(!mCallback);
mCallback = new FilePickerShownCallback(this);
mFilePicker->Open(mCallback);

View file

@ -69,7 +69,7 @@ class FilePickerParent : public PFilePickerParent
private:
virtual ~FilePickerShownCallback() {}
FilePickerParent* mFilePickerParent;
RefPtr<FilePickerParent> mFilePickerParent;
};
private:
@ -78,7 +78,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;