Skip to content

Add synchronized to onIntermediateImageFailed #2828

Closed
bjornarjatten wants to merge 1 commit into
facebook:mainfrom
bjornarjatten:main
Closed

Add synchronized to onIntermediateImageFailed #2828
bjornarjatten wants to merge 1 commit into
facebook:mainfrom
bjornarjatten:main

Conversation

@bjornarjatten

Copy link
Copy Markdown
Contributor

Motivation

This pull request synchronizes the onIntermediateImageFailed method in ForwardingControllerListener.
The method iterates over a shared list of listeners (mListeners), and without synchronization, it may result in concurrent modification exceptions or inconsistent behavior if accessed from multiple threads simultaneously.
Other similar methods like onFinalImageSet and onFailure are already synchronized, so this change brings consistency and improves thread safety.

Test Plan

Ran ./gradlew build

to onIntermediateImageFailed
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@oprisnik has imported this pull request. If you are a Meta employee, you can view this in D78988254.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@oprisnik merged this pull request in ac97e97.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants