Stop using camera after it was released
We see an increased number of crashes caused by uncaught exceptions indicating the camera was used after release. The reported crash is also reproducible on one of our test devices by opening certain chat pages in the Opera browser. Using the camera after release() was called is an error, but this would still happen if Camera#getParameters() fails with an exception because we would then call release() without nulling the reference to the released camera instance. Later on we will use the released instance to close the camera preview, causing a new exception that will crash the browser as it is not caught. This change fixes the use-after-release crash by nulling the camera reference after a failure, to prevent any further usage after the camera was released. Bug: 1125083 Change-Id: Ibbf3099636f3e25692fae4799255d04f2cfd4e3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2527138Reviewed-by:Henrik Andreasson <henrika@chromium.org> Reviewed-by:
Guido Urdaneta <guidou@chromium.org> Reviewed-by:
Markus Handell <handellm@google.com> Commit-Queue: Olle Liljenzin <ollel@opera.com> Cr-Commit-Position: refs/heads/master@{#825807}
Showing
Please register or sign in to comment