MarshallOfSound

#53738: fix: cppgc object lifetime follow-ups

Merged
Created: Sep 8, 2026, 5:43:25 AM
Merged: Sep 9, 2026, 6:19:05 PM
3 comments
Target: main

Description of Change

Follow-ups from an audit of the cppgc-managed API objects. One commit per fix; tests to follow.

  • Debugger: detach from the DevToolsAgentHost when collected
  • DataPipeHolder: prune the id registry on collection
  • ReplyChannel: keep the invoke callback when a handler result can't be serialized
  • node_util: don't CHECK when emitting a warning from a renderer
  • shell.openPath(): settle the promise on Linux
  • ServiceWorkerMain: only erase its own registry entry; destroy stopped redundant versions
  • utilityProcess: release wrappers whose child never launches
  • globalShortcut: unregister portal shortcuts on Linux; ignore stale activations
  • Notification: don't orphan a platform notification created by a re-entrant show()
  • webFrame: look up the RenderFrame after reading arguments
  • WebFrameMain: adopt a newly committed RFH in From(); dispose frames of released guest/background-page WebContents
  • systemPreferences / MSIX updater: keep gin_helper::Promise on the UI thread
  • sharedTexture: release imported textures on their owning sequence
  • Menu / Tray: keep the Menu alive while native code still references its model
  • net.request: fail a chunked upload the network stack asks to replay instead of re-entering the JS body
  • MessagePortMain: re-check entanglement after serializing the message
  • netLog: settle the stopLogging() promise if the exporter pipe disconnects
  • Destroyable: reject foreign receivers in destroy()
  • utility process: tear down AI receivers before the isolate

The NativeImage / EventEmitterMixin per-context template duplication is left to #53678.

cc @deepak1556

Checklist

  • PR description included

Release Notes

Notes: Fixed several object lifetime issues in Debugger, Menu, Tray, Notification, globalShortcut, utilityProcess, ServiceWorkerMain, WebFrameMain, webFrame, sharedTexture, systemPreferences, netLog, MessagePortMain, net.request and shell.openPath().

Backports

45-x-y
Merged
PR Number
#53805
Merged At
Sep 9, 2026, 10:17:19 PM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron