Skip to content

fix: prevent orphan leak in SetContentView - #52894

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

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

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 44-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 ab2c8b7 into 44-x-y Aug 17, 2026
137 of 139 checks passed
@MarshallOfSound
MarshallOfSound deleted the trop/44-x-y-bp-fix-prevent-orphan-leak-in-setcontentview-1786946646503 branch August 17, 2026 09:07
@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

44-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