Skip to content

Commit

Permalink
Eliminate PDF viewer crashes (PP-1822).
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed Oct 28, 2024
1 parent 95ea5f2 commit 19fa287
Showing 1 changed file with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,24 @@ class PdfReaderActivity : AppCompatActivity() {
}

override fun onDestroy() {
this.pdfServer?.stop()
this.pdfReaderContainer.removeAllViews()
this.webView.destroy()
try {
this.pdfServer?.stop()
} catch (e: Throwable) {
this.log.debug("Failed to stop PDF server: ", e)
}

try {
this.pdfReaderContainer.removeAllViews()
} catch (e: Throwable) {
this.log.debug("Failed to remove PDF views: ", e)
}

try {
this.webView.destroy()
} catch (e: Throwable) {
this.log.debug("Failed to destroy web view: ", e)
}

super.onDestroy()
}

Expand Down

0 comments on commit 19fa287

Please sign in to comment.