Closed Bug 1920053 Opened 2 months ago Closed 2 months ago

Several navigation methods leak registered observers through the ProgressListener

Categories

(Remote Protocol :: Agent, defect, P2)

defect
Points:
2

Tracking

(firefox132 fixed)

RESOLVED FIXED
132 Branch
Tracking Status
firefox132 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [webdriver:m12])

Attachments

(1 file)

I noticed that issue when investigating bug 1891706. Whenever we open a new tab the method waitForInitialNavigationCompleted is called to await the initial about:blank page to be loaded.

Because this method uses the ProgressListener class which itself makes use of the PromptListener class several observer notifications are getting registered when the PromptListener is started to listen.

In the waitForInitialNavigationCompleted method we for sure wait for the navigation to be done but we never call listener.destroy(). As such the progress listener will be removed when it gets out of scope but all the registered observers remain active.

To fix that we have to explicitly call listener.destroy() before leaving the scope of the method.

Indeed. We should fix those all. Thanks!

Summary: "waitForInitialNavigationCompleted" leaks ProgressListener instances → Several navigation methods leak registered observers through the ProgressListener
See Also: → 1920070
Severity: -- → S3
Points: --- → 2
Priority: -- → P2
Whiteboard: [webdriver:m12]
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7feb4c39dd8c [remote] Make sure to call ProgressListener.destroy() to not leak registered observers and events. r=webdriver-reviewers,jdescottes
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: