Skip to content

fix: prevent orphan leak in SetContentView - #52892

Merged
MarshallOfSound merged 1 commit into
43-x-yfrom
trop/43-x-y-bp-fix-prevent-orphan-leak-in-setcontentview-1786946645148
Aug 17, 2026
Merged

MarshallOfSound merged 1 commit into
43-x-yfrom
trop/43-x-y-bp-fix-prevent-orphan-leak-in-setcontentview-1786946645148

Conversation

@trop

@trop trop Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Backport of #52092

See that PR for details.

Notes: Fixed a memory leak when creating BrowserWindows.

SetContentView detached the previous content view with RemoveChildView,
which removes it from the view hierarchy without destroying it. For
views Electron owns (not owned_by_client), this leaked the view on
every replacement.

Use RemoveChildViewT to delete views we own, keep RemoveChildView for
client owned views that must outlive removal, and clear
content_view_/focused_view_ before removal so neither references a
destroyed view.

Co-authored-by: Geoffrey Ostosh <[email protected]>
@trop trop Bot mentioned this pull request Aug 17, 2026
5 of 6 tasks
@trop trop Bot added 43-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Aug 17, 2026
@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) August 17, 2026 06:34
@MarshallOfSound
MarshallOfSound merged commit 04a4c08 into 43-x-y Aug 17, 2026
198 of 202 checks passed
@MarshallOfSound
MarshallOfSound deleted the trop/43-x-y-bp-fix-prevent-orphan-leak-in-setcontentview-1786946645148 branch August 17, 2026 11:36
@release-clerk

release-clerk Bot commented Aug 17, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed a memory leak when creating BrowserWindows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

43-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant