mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 02:14:43 +00:00
Bug 1903034 - Call DropJSObjects after a promise callback has been called r=mccr8
For promise callbacks we call CallbackObject::Reset after the callback has been called to clear JS references and avoid keeping JS GC things around longer than necessary (promise callbacks can only be called once). We don't need to keep the callback object in the JS holders table after this point. Differential Revision: https://phabricator.services.mozilla.com/D213949
This commit is contained in:
parent
766ad95b55
commit
009b9bd811
@ -264,7 +264,10 @@ class CallbackObject : public nsISupports {
|
||||
// this point. This should only be called if the object is known not to be
|
||||
// used again, and no handles (e.g. those returned by CallbackPreserveColor)
|
||||
// are in use.
|
||||
void Reset() { ClearJSReferences(); }
|
||||
void Reset() {
|
||||
ClearJSReferences();
|
||||
mozilla::DropJSObjects(this);
|
||||
}
|
||||
friend class mozilla::PromiseJobRunnable;
|
||||
|
||||
inline void ClearJSReferences() {
|
||||
|
Loading…
Reference in New Issue
Block a user