File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
sentry-android-core/src/main/java/io/sentry/android/core/internal/util Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## Unreleased
4+
5+ ### Fixes
6+
7+ - Fix concurrent access to frameMetrics listener ([ #2823 ] ( https://github.com/getsentry/sentry-java/pull/2823 ) )
8+
39## 6.25.0
410
511### Features
Original file line number Diff line number Diff line change 1919import io .sentry .util .Objects ;
2020import java .lang .ref .WeakReference ;
2121import java .lang .reflect .Field ;
22- import java .util .HashMap ;
23- import java .util .HashSet ;
22+ import java .util .Map ;
2423import java .util .Set ;
2524import java .util .UUID ;
25+ import java .util .concurrent .ConcurrentHashMap ;
26+ import java .util .concurrent .CopyOnWriteArraySet ;
2627import org .jetbrains .annotations .ApiStatus ;
2728import org .jetbrains .annotations .NotNull ;
2829import org .jetbrains .annotations .Nullable ;
2930
3031@ ApiStatus .Internal
3132public final class SentryFrameMetricsCollector implements Application .ActivityLifecycleCallbacks {
3233 private final @ NotNull BuildInfoProvider buildInfoProvider ;
33- private final @ NotNull Set <Window > trackedWindows = new HashSet <>();
34+ private final @ NotNull Set <Window > trackedWindows = new CopyOnWriteArraySet <>();
3435 private final @ NotNull SentryOptions options ;
3536 private @ Nullable Handler handler ;
3637 private @ Nullable WeakReference <Window > currentWindow ;
37- private final @ NotNull HashMap <String , FrameMetricsCollectorListener > listenerMap =
38- new HashMap <>();
38+ private final @ NotNull Map <String , FrameMetricsCollectorListener > listenerMap =
39+ new ConcurrentHashMap <>();
3940 private boolean isAvailable = false ;
4041 private final WindowFrameMetricsManager windowFrameMetricsManager ;
4142
You can’t perform that action at this time.
0 commit comments