Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Instance::unregisterSurface() in the destroy funct of the create …
…surface ... method of the `struct wl_compositor_interface` This commits prevents crashes by accessing to already deleted Surfaces destroyed by a premature wl_client_destroy method call. For example, trying to load a non-allowed URI filtered by a Content-Filter policy. Changes: * The Instance class implements an Instance::unregisterSurface(). * The destroy callback in the wl_resource_set_implementation for the created Surface now includes a Instance::unregisterSurface(). For this removes the surface from the ViewBackendMap avoiding dispatch operations over a already destroyed Surface. * The Instance::dispatchFrameCallbacks(uint32_t bridgeId) still checks if the bridgeId has an associated Surface in the ViewBackendMap but now just logs a warning message and avoids to fail when associated element is not found. Instead of that the logic now just skips the dispatchFrameCallbacks if the surface is there. Co-authored-by: Adrian Perez de Castro <aperez@igalia.com> Acked-by: Adrian Perez de Castro <aperez@igalia.com> Signed-off-by: Pablo Saavedra <psaavedra@igalia.com>
- Loading branch information