Bug 1904407 - Clear nsColorPickerProxy's callback when we destroy the actor. a=dmeehan

Original Revision: https://phabricator.services.mozilla.com/D214739

Differential Revision: https://phabricator.services.mozilla.com/D216959
This commit is contained in:
Andrew McCreight 2024-07-18 16:00:54 +00:00
parent 6d349fbdac
commit ab63865b5d
2 changed files with 8 additions and 0 deletions

View file

@ -52,3 +52,10 @@ mozilla::ipc::IPCResult nsColorPickerProxy::Recv__delete__(
}
return IPC_OK();
}
void nsColorPickerProxy::ActorDestroy(ActorDestroyReason aWhy) {
if (mCallback) {
mCallback->Done(u""_ns);
mCallback = nullptr;
}
}

View file

@ -21,6 +21,7 @@ class nsColorPickerProxy final : public nsIColorPicker,
virtual mozilla::ipc::IPCResult RecvUpdate(const nsAString& aColor) override;
virtual mozilla::ipc::IPCResult Recv__delete__(
const nsAString& aColor) override;
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
private:
~nsColorPickerProxy() = default;