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

System.ObjectDisposedException: Cannot access a disposed object #9

Open
shivraj251 opened this issue Oct 9, 2020 · 4 comments
Open

Comments

@shivraj251
Copy link

Getting this exception in some of the Android devices.
FormsPinView(2.1.0-pre1)

Object name: 'Android.Graphics.Paint'.
at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <07754f4cea12486d9464281b313bc550>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <07754f4cea12486d9464281b313bc550>:0
at Android.Graphics.Paint.set_Alpha (System.Int32 value) [0x00022] in <61fdc70e3ec6449cbca4b2444bcf1f69>:0
at FormsPinView.Droid.RippleButton+<>c__DisplayClass17_0.b__0 () [0x0003a] in <49f4c9956baa4d22a04ad433dcdfbd74>:0
at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <61fdc70e3ec6449cbca4b2444bcf1f69>:0
at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <61fdc70e3ec6449cbca4b2444bcf1f69>:0
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.48(intptr,intptr)

@Joebu
Copy link

Joebu commented Jun 9, 2021

@shivraj251 did you get around this?

@lassana
Copy link
Owner

lassana commented Jun 9, 2021

@Joebu most likely you need to adjust RippleButton class:

public void Dispose(bool isDisposing)
{
    if (isDisposing)
    {
        _handler?.RemoveCallbacksAndMessages(null);
    }
    base.Dispose(isDisposing);
}

@shivraj251
Copy link
Author

@Joebu, no i could not get any solution finally I removed the FormsPinView and implement custom layout that is working well.

@shivraj251
Copy link
Author

@lassana I tried but getting same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants