Files
servo/components/shared/compositing
Martin Robinson 1d0099e2ed compositing: Drop Painters when they have no WebViews (#41144)
Remove `Painter`s from the `Compositor` when their final `WebView` is
dropped. This ensures that their resources are properly released and
deinitialized, such as the WebRender instance and all of its resources.
Without this change, these things leak.

This change requires the ability to handle inexistant `Painter`s during
message handling, as messages from other parts of the `Constellation`
for a `Painter` can arrive after it has been released. We don't really
need to do this for `Compositor` API calls because they are triggered
via the `WebView`. When a `WebView` is alive its `Painter` should always
also be alive, so the `expect()` call still makes sense in that case.

Part of this also involves removing the redundant `RemoveWebView`
message to the `Compositor`. This is handled now in the `WebView` `Drop`
implementation for both simplicity and necessity.

Testing: This should not change observable behavior, but does fix a
memory leak
while closing windows.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-12-09 10:37:16 +00:00
..