Cannot access a disposed object.

Hello,

I'm using SFSwitch inside SFRotator to create a wizard form and it works fine. However if go through the form then go back and uncheck SFSwitch the application crashes with the error Cannot access a disposed object.


Stack trace:

Unhandled Exception:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'ElementViewRenderer'.
  at Foundation.NSObject.get_SuperHandle () [0x00012] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.10.0.17/src/Xamarin.iOS/Foundation/NSObject2.cs:449 
  at UIKit.UIView.set_AccessibilityLabel (System.String value) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.10.0.17/src/Xamarin.iOS/UIView.g.cs:2598 
  at Syncfusion.XForms.iOS.Buttons.ElementViewRenderer.FormsBorder_PropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00044] in <0a97a6c20fb64e7eb7565e17821dd1d8>:0 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:229 
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:353 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00114] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:461 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:397 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x00042] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:334 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:311 
  at Syncfusion.XForms.Buttons.SfTrack.AssigniOSAccessibiltyText () [0x0013c] in <3b788020307d4ca38d67f7d186a0250b>:0 
  at Syncfusion.XForms.Buttons.SfTrack.SetAccessibilityText () [0x00018] in <3b788020307d4ca38d67f7d186a0250b>:0 
  at Syncfusion.XForms.Buttons.SfSwitch.OnIsOnPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x00037] in <3b788020307d4ca38d67f7d186a0250b>:0 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:463 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:397 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x00042] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:334 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:311 
  at Syncfusion.XForms.Buttons.SfSwitch.ForceStateChanged (System.Nullable`1[T] state) [0x0002c] in <3b788020307d4ca38d67f7d186a0250b>:0 
  at Syncfusion.XForms.Buttons.SfSwitch.ValidateStateChange (System.Nullable`1[T] state) [0x0003b] in <3b788020307d4ca38d67f7d186a0250b>:0 
  at Syncfusion.XForms.Buttons.SfSwitch.set_IsOn (System.Nullable`1[T] value) [0x00013] in <3b788020307d4ca38d67f7d186a0250b>:0 
  at Syncfusion.XForms.Buttons.SfTrack.OffBorderTapGesture_Tapped (System.Object sender, System.EventArgs e) [0x00081] in <3b788020307d4ca38d67f7d186a0250b>:0 
  at Xamarin.Forms.TapGestureRecognizer.SendTapped (Xamarin.Forms.View sender) [0x0002e] in D:\a\1\s\Xamarin.Forms.Core\TapGestureRecognizer.cs:48 
  at Xamarin.Forms.Platform.iOS.EventTracker+<>c__DisplayClass13_0.<CreateRecognizerHandler>b__0 (UIKit.UITapGestureRecognizer sender) [0x0008f] in D:\a\1\s\Xamarin.Forms.Platform.iOS\EventTracker.cs:201 
  at UIKit.UITapGestureRecognizer+Callback.Activated (UIKit.UITapGestureRecognizer sender) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.10.0.17/src/Xamarin.iOS/UIKit/UIGestureRecognizer.cs:223 
--- End of stack trace from previous location where exception was thrown ---

Thanks,



3 Replies

SP Sakthivel Palaniyappan Syncfusion Team May 4, 2020 10:41 AM UTC

Hi Hassan,

Greetings from Syncfusion.

Currently we are analyzing the root cause of the issue and we will update the details on May 6th, 2020. We appreciate your patience until then.

Regards,
Sakthivel P.



SP Sakthivel Palaniyappan Syncfusion Team May 6, 2020 01:52 PM UTC

Hi Hassan,

Thanks for the patience.

We are able to reproduce the reported issue and we have fixed the issue. Please find the custom assembly from below link.

Custom assembly:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/Switch_CustomAssembly677922609

Assembly Version: 18.1.0.48

Disclaimer:
Please note that we have created this patch for version 18.1.0.42 specifically to resolve the  issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received.

Fix for the reported issue will be included in our upcoming Volume 1 SP1 2020 release which is expected to be rolled out on mid of May 2020.We appreciate your patience until then.

Regards, 
Sakthivel P. 



MS Mugundhan Saravanan Syncfusion Team May 18, 2020 10:21 AM UTC

Hi Hassan,

Thanks for your patience.

As we promised, we have included the fix for the reported issue in our Essential Studio 2020 Volume 1 SP release v18.1.0.52 is rolled out and is available for download under the following link.

https://www.syncfusion.com/forums/154238/essential-studio-2020-volume-1-service-pack-release-v18-1-0-52-is-available-for-download  

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.

Regards,
Mugundhan S.

Loader.
Up arrow icon