This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Conditionally call FlutterViewDestroyOverlaySurfaces#31464
Merged
fluttergithubbot merged 6 commits intoflutter:mainfrom Feb 17, 2022
Merged
Conditionally call FlutterViewDestroyOverlaySurfaces#31464fluttergithubbot merged 6 commits intoflutter:mainfrom
fluttergithubbot merged 6 commits intoflutter:mainfrom
Conversation
| bool needsLayer; | ||
| { | ||
| std::lock_guard lock(layers_mutex_); | ||
| needsLayer = available_layer_index_ >= layers_.size(); |
Member
There was a problem hiding this comment.
Is there any risk that the layers_ list may be modified between this check and the time when the layer is used?
The lock may need to be held during the entire operation. Or it may need an approach such as:
- with the lock held:
- obtain a layer if available and remove it from
layers_
- obtain a layer if available and remove it from
- if no layer was available, then create a layer
- with the lock held:
- set up the layer and insert it into
layers_
- set up the layer and insert it into
Author
There was a problem hiding this comment.
I changed it in 117787a, so the lock is held during the entire operation. PTAL
jason-simmons
approved these changes
Feb 17, 2022
| DestroyLayersUnsafe(jni_facade); | ||
| } | ||
|
|
||
| void SurfacePool::DestroyLayersUnsafe( |
Member
There was a problem hiding this comment.
Consider using the suffix Locked for this API instead of Unsafe. This method is safe as long as the caller holds the lock.
e951c61 to
c0bb667
Compare
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 17, 2022
This was referenced Feb 25, 2022
itsjustkevin
pushed a commit
to itsjustkevin/engine
that referenced
this pull request
Feb 28, 2022
itsjustkevin
added a commit
that referenced
this pull request
Feb 28, 2022
* Conditionally call FlutterViewDestroyOverlaySurfaces (#31464) * Fix PhysicalShapeLayer paint bounds with clipping disabled (#31656) * Fix PhysicalShapeLayer paint bounds with clipping disabled * Add missing SkRect initialization * 'add branch flutter-2.8-candidate.16 to enabled_branches in .ci.yaml' * remove branch ref Co-authored-by: Emmanuel Garcia <[email protected]> Co-authored-by: Matej Knopp <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes flutter/flutter#98530
On Android, the external view embedder may post a task to the platform
thread, and wait until it completes if overlay surfaces must be released during
application startup.
However, the platform thread might be blocked when Dart is initializing.