diff --git a/Source/ZXing.Net.Mobile.Android/ZXingTextureView.cs b/Source/ZXing.Net.Mobile.Android/ZXingTextureView.cs index e55357608..a119aa6b4 100644 --- a/Source/ZXing.Net.Mobile.Android/ZXingTextureView.cs +++ b/Source/ZXing.Net.Mobile.Android/ZXingTextureView.cs @@ -296,7 +296,13 @@ void SetSurfaceTransform(SurfaceTexture st, int width, int height) var transform = new Matrix(); transform.SetScale(1f, aspectRatio * width / height); // lock on to width - Post(() => SetTransform(transform)); // ensure we use the right thread when updating transform + Post(() => { + try + { + SetTransform(transform); + } + catch (ObjectDisposedException) { } // todo: What to do here?! For now we squash :-/ + }); // ensure we use the right thread when updating transform Log.Debug(MobileBarcodeScanner.TAG, $"Aspect ratio: {aspectRatio}, Transform: {transform}");