summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-08-30 19:30:17 +0200
committerMoonchild <moonchild@palemoon.org>2023-08-30 19:30:17 +0200
commit7de2732e7f68e55a24ee9628752a5a620d0eac6e (patch)
treeb1bd8adb9c0f3e76c081b628959c803ef5b25b2f
parentf20e3f4dd16285c9b484a8abb144f2a51d93ac07 (diff)
downloaduxp-7de2732e7f68e55a24ee9628752a5a620d0eac6e.tar.gz
[DOM] Make IORunnable::mFilePickerParent into a RefPtr.
-rw-r--r--dom/ipc/FilePickerParent.cpp1
-rw-r--r--dom/ipc/FilePickerParent.h4
2 files changed, 3 insertions, 2 deletions
diff --git a/dom/ipc/FilePickerParent.cpp b/dom/ipc/FilePickerParent.cpp
index 1438e374fe..0271890758 100644
--- a/dom/ipc/FilePickerParent.cpp
+++ b/dom/ipc/FilePickerParent.cpp
@@ -286,6 +286,7 @@ FilePickerParent::RecvOpen(const int16_t& aSelectedType,
}
}
+ MOZ_ASSERT(!mCallback);
mCallback = new FilePickerShownCallback(this);
mFilePicker->Open(mCallback);
diff --git a/dom/ipc/FilePickerParent.h b/dom/ipc/FilePickerParent.h
index 332007a715..7ab2f7dab1 100644
--- a/dom/ipc/FilePickerParent.h
+++ b/dom/ipc/FilePickerParent.h
@@ -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;