Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed crash when nav'ing back #14

Closed
wants to merge 1 commit into from

Conversation

@MarcosCobena
Copy link

commented Dec 10, 2018

This fixes the following crash in Android:

​​​​[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] System.ObjectDisposedException: Cannot access a disposed object.
[MonoDroid] Object name: 'Sharpnado.Presentation.Forms.Droid.Renderers.HorizontalList.SlowRecyclerView'.
[MonoDroid]   at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <0ad2222fd7074badb5de547b1521aab0>:0 
[MonoDroid]   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualInt32Method (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <0ad2222fd7074badb5de547b1521aab0>:0 
[MonoDroid]   at Android.Views.View.get_Height () [0x0000a] in <ad2f15102b3a4d36b40e9b0cbc11c376>:0 
[MonoDroid]   at Sharpnado.Presentation.Forms.Droid.Renderers.HorizontalList.AndroidHorizontalListViewRenderer.OnPreDraw (System.Object sender, Android.Views.ViewTreeObserver+PreDrawEventArgs e) [0x0000b] in D:\Dev\Sharpnado\src\Xamarin-Forms-Practices\Sharpnado.Presentation.Forms\Sharpnado.Presentation.Forms.Droid\Renderers\HorizontalList\AndroidHorizontalListViewRenderer.cs:135 
[MonoDroid]   at Android.Views.ViewTreeObserver+IOnPreDrawListenerImplementor.OnPreDraw () [0x00013] in <ad2f15102b3a4d36b40e9b0cbc11c376>:0 
[MonoDroid]   at Android.Views.ViewTreeObserver+IOnPreDrawListenerInvoker.n_OnPreDraw (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <ad2f15102b3a4d36b40e9b0cbc11c376>:0 
[MonoDroid]   at (wrapper dynamic-method) System.Object.110(intptr,intptr)
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for 'java_interop_jnienv_throw'.
[Mono] Probing 'java_interop_jnienv_throw'.
[Mono] Found as 'java_interop_jnienv_throw'.
[mono] 
[mono] Unhandled Exception:
[mono] System.ObjectDisposedException: Cannot access a disposed object.
[mono] Object name: 'Sharpnado.Presentation.Forms.Droid.Renderers.HorizontalList.SlowRecyclerView'.
[mono]   at (wrapper dynamic-method) System.Object.110(intptr,intptr)
[mono]   at (wrapper native-to-managed) System.Object.110(intptr,intptr)
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.ObjectDisposedException: Cannot access a disposed object.
[mono-rt] Object name: 'Sharpnado.Presentation.Forms.Droid.Renderers.HorizontalList.SlowRecyclerView'.
[mono-rt]   at (wrapper dynamic-method) System.Object.110(intptr,intptr)
[mono-rt]   at (wrapper native-to-managed) System.Object.110(intptr,intptr)
@roubachof

This comment has been minimized.

Copy link
Owner

commented Dec 17, 2018

Thanks for your PR!

It will be resolved in the next release with the JniExtensions IsNullOrDisposed() method.

@roubachof roubachof closed this Dec 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.