Skip to content

[MS-1238] Crash fix: no longer accessing views when Fragment is destroyed#1455

Merged
alexandr-simprints merged 2 commits into
release/2025.4.0from
MS-1238-mf-id-remove-references-to-binding-from-async-thread
Nov 10, 2025
Merged

[MS-1238] Crash fix: no longer accessing views when Fragment is destroyed#1455
alexandr-simprints merged 2 commits into
release/2025.4.0from
MS-1238-mf-id-remove-references-to-binding-from-async-thread

Conversation

@alexandr-simprints
Copy link
Copy Markdown
Contributor

@alexandr-simprints alexandr-simprints commented Nov 7, 2025

JIRA ticket
Will be released in: 2025.4.0

Root cause analysis (for bugfixes only)

First known affected version: 2025.4.0

In OCR preprocessing function, the binding reference may be accessed from the background thread when Fragment has already been destroyed. This leads to run-time crashes in rare cases.

Notable changes

  • Moving OCR preprocessing to a single preProcessImageAndRunOcr function
  • Returning reference for preprocessing execution thread
  • Cancelling preprocessing scope in onDestroyView, since preprocessing requires access to views for a proper image crop
  • Preprocessing now checks if the coroutine scope is still active

Testing guidance

  • Describe how the reviewers can verify that issue is fixed

Additional work checklist

  • Effect on other features and security has been considered

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Nov 7, 2025

@alexandr-simprints alexandr-simprints merged commit 99fd210 into release/2025.4.0 Nov 10, 2025
13 checks passed
@alexandr-simprints alexandr-simprints deleted the MS-1238-mf-id-remove-references-to-binding-from-async-thread branch November 10, 2025 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants