iOS 10+ crash in plugin version 1.1.0-pre2
See original GitHub issuePCL Interface:
public class NavigationInternal : INavigationInternal
{
public async Task ShowItemsAsync(object context)
{
await PopupNavigation.Instance.PushAsync(
new PopupItemsPage { BindingContext = context });
}
}
PCL Usage:
await navigationInternal.ShowItemsAsync(this); // (this) -> instance of VM
PCL Popup class:
public partial class PopupItemsPage : Rg.Plugins.Popup.Pages.PopupPage
{
public PopupItemsPage()
{
InitializeComponent();
}
}
It is crashing on iOS 10+, after multiple open/close of popup. P.S. Opening by code, close by tapping background (and make it for multiple times)
Please see the info: NSObject.get_SuperHandle () /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/Foundation/NSObject2.cs line 423 System.ObjectDisposedException: Cannot access a disposed object. Object name: ‘PopupPageRenderer’.
CANNOT ACCESS A DISPOSED OBJECT. OBJECT NAME: ‘POPUPPAGERENDERER’.
_NSObject.get_SuperHandle () /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/Foundation/NSObject2.cs:423
UIViewController.ViewDidLayoutSubviews () /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/build/ios/native/UIKit/UIViewController.g.cs:1210
PopupPageRenderer.ViewDidLayoutSubviews ()
Trampolines+SDAction.Invoke (System.IntPtr block) /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/build/ios/native/ObjCRuntime/Trampolines.g.cs:10343
(wrapper native-to-managed) ObjCRuntime.Trampolines+SDAction:Invoke (intptr)
(wrapper managed-to-native) ObjCRuntime.Messaging:void_objc_msgSend_Double_IntPtr_IntPtr (intptr,intptr,double,intptr,intptr)
UIView.AnimateNotify (System.Double duration, System.Action animation, UIKit.UICompletionHandler completion) /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/build/ios/native/UIKit/UIView.g.cs:370
UIView.AnimateNotifyAsync (System.Double duration, System.Action animation) /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/build/ios/native/UIKit/UIView.g.cs:382
UIView.AnimateAsync (System.Double duration, System.Action animation) /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/UIKit/UIView.cs:177
PopupPageRenderer+<KeyBoardDownNotification>d__19.MoveNext ()
ExceptionDispatchInfo.Throw () /Library/Frameworks/Xamarin.iOS.framework/Versions/10.10.0.36/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) /Library/Frameworks/Xamarin.iOS.framework/Versions/10.10.0.36/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1018
UIKitSynchronizationContext+<Post>c__AnonStorey0.<>m__0 () /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/UIKit/UIKitSynchronizationContext.cs:24
NSAsyncActionDispatcher.Apply () /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/Foundation/NSAction.cs:163
(wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/UIKit/UIApplication.cs:79
UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/UIKit/UIApplication.cs:63
Application.Main (System.String[] args) /Users/alezhuk/Project_X/PinPayment/PinPayment/PinPayment.iOS/Main.cs:14_
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:25 (10 by maintainers)

Top Related StackOverflow Question
@rotorgames Using latest, 1.1.4.158-pre. Here is the stack trace I see in AppCenter but I am unable to repro this for now. But I do see users encountering it.
Xamarin Exception Stack: System.NullReferenceException: Object reference not set to an instance of an object at Rg.Plugins.Popup.IOS.Renderers.PopupPageRenderer.ViewDidLayoutSubviews () <0x101db4e54 + 0x0005c> in <c2bf6f1e86b84161baab0dfc470e68f9#510e478a0d8b9e3668d2cdf02e572773>:0 at (wrapper managed-to-native) ObjCRuntime.Messaging.objc_msgSend(intptr,intptr) at CoreAnimation.CATransaction.Commit () <0x1010f6498 + 0x00023> in <0b60c1467e7449608ac42f9c7bbfdd05#510e478a0d8b9e3668d2cdf02e572773>:0 at Xamarin.Forms.Platform.iOS.CADisplayLinkTicker.StartThread () <0x101478e04 + 0x0002f> in <3d97176e5e4b463eb17f36e790a716e1#510e478a0d8b9e3668d2cdf02e572773>:0 at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) <0x10086cbd8 + 0x000e3> in <b238a3153e534349ad10ed0787f2157a#510e478a0d8b9e3668d2cdf02e572773>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) <0x10086b268 + 0x00227> in <b238a3153e534349ad10ed0787f2157a#510e478a0d8b9e3668d2cdf02e572773>:0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) <0x10086b1f4 + 0x0002f> in <b238a3153e534349ad10ed0787f2157a#510e478a0d8b9e3668d2cdf02e572773>:0 at System.Threading.ThreadHelper.ThreadStart () <0x10086cd88 + 0x0002f> in <b238a3153e534349ad10ed0787f2157a#510e478a0d8b9e3668d2cdf02e572773>:0
@rotorgames Do you think this bug will get fixed anytime soon? I’m only asking because I’d like to help fix it ASAP. This bug with the latest version 1.1.0 pre2 has completely stopped development for my dev team. let me know, thank you