Same problem if I remove that code,
https://gist.github.com/Nordis/6129762
I was able to reproduce the crash a lot quicker when I removed the code,
usually the crash occurs after 1-2 minutes. But with no code att all in
Dispose the crash occured after a few seconds.
Also the crash only seems to happens when I compile in release mode.
2013/8/1 Nic Wise [via MonoTouch] <[email protected]
>
> That SO question is from 2011, and the GC and other things have
> changed hugely since then, esp in 6.4 (the latest one) which is Mono
> 3.x as well as having a new GC by default
>
> So you may not even need to do that. What happens if you take it out
> completely?
>
> Rolf is often around here, so he may be able to expand on it a bit.
>
> On 1 August 2013 09:53, Nordis <[hidden
> email]<http://user/SendEmail.jtp?type=node&node=4658408&i=0>>
> wrote:
>
> > Thanks for your quick reply,
> >
> > I've tried to change BeginInvokeOnMainThread to InvokeOnMainThread, but
> > still the same problem. The crash dump looks the same to me,
> > https://gist.github.com/Nordis/6129637
> >
> > Then I tried to remove InvokeOnMainThread and only set the properties to
> > null,
> > searchController.Delegate = null;
> > searchController.SearchResultsDelegate = null;
> > searchController.SearchResultsSource = null;
> >
> > But then I got this exception,
> > MonoTouch.UIKit.UIKitThreadAccessException: UIKit Consistency error: you
> are
> > calling a UIKit method that can only be invoked from the UI thread.
> > at MonoTouch.UIKit.UIApplication.EnsureUIThread () [0x00000] in
> <filename
> > unknown>:0
> > at MonoTouch.UIKit.UISearchDisplayController.set_WeakDelegate
> > (MonoTouch.Foundation.NSObject value) [0x00000] in <filename unknown>:0
> > at MonoTouch.UIKit.UISearchDisplayController.set_Delegate
> > (MonoTouch.UIKit.UISearchDisplayDelegate value) [0x00000] in <filename
> > unknown>:0
> > at Diet52App.FoodSearchBase.Dispose (Boolean disposing) [0x00000] in
> > <filename unknown>:0
> > at MonoTouch.Foundation.NSObject.Finalize () [0x00000] in <filename
> > unknown>:0
> >
> > I got the idea to set searchController's properties to null by reading
> this
> > thread,
> >
> http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
> >
> > Best regards,
> >
> > Daniel
> >
> >
> > 2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
> >>
> >> Hi Nordis
> >>
> >> If I had to guess, I'd say this is the problem
> >>
> >> protected override void Dispose (bool disposing)
> >> {
> >> // Hopefully fixes SIGSEGV error
> >> //
> >>
> http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
> >> BeginInvokeOnMainThread (() => {
> >> searchController.Delegate = null;
> >> searchController.SearchResultsDelegate = null;
> >> searchController.SearchResultsSource = null;
> >> });
> >> base.Dispose (disposing);
> >> }
> >>
> >>
> >> BeginInvokeOnMainThread will call it and return immediately - so your
> >> searchController may have been disposed of by the time the background
> >> thread runs.
> >>
> >> try changing it to either not use the call at all, or use
> >> InvokeOnMainThread, which waits for the code to execute before
> >> continuing.
> >>
> >>
> >> "Unlike NSObject.BeginInvokeOnMainThread(NSAction) this method waits
> >> for the main thread to execute the method, and does not return until
> >> the code pointed by action has completed running."
> >>
> >>
> >>
> >>
> >> On 1 August 2013 09:16, Nordis <[hidden email]> wrote:
> >>
> >> > I'm having problem to find the cause of random crashes in my app. The
> >> > crashes
> >> > only occurs when I build in release mode and run on a device like
> iPhone
> >> > or
> >> > iPad. Running in debug on simulator no crashes occurs. My guess is
> that
> >> > the
> >> > problem has something to do with these two lines in the crash log,
> >> >
> >> > 6 UIKit 0x34a193d0
> >> > -[UISearchDisplayController
> >> > _destroyManagedTableView] + 68
> >> > 7 UIKit 0x34a2195a
> >> > -[UISearchDisplayController
> >> > dealloc] + 94
> >> > I've uploaded the source code of my UITableViewController and the
> full
> >> > crash
> >> > log here, https://gist.github.com/Nordis/6128735
> >> >
> >> > All help to track the cause of the crashes is much appreciated!
> >> >
> >> >
> >> >
> >> > --
> >> > View this message in context:
> >> >
> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405.html
> >> > Sent from the MonoTouch mailing list archive at Nabble.com.
> >> > _______________________________________________
> >> > MonoTouch mailing list
> >> > [hidden email]
> >> > http://lists.ximian.com/mailman/listinfo/monotouch
> >>
> >>
> >>
> >> --
> >> Nic Wise
> >> t. <a href="tel:%2B44%207788%20592%20806" value="+447788592806"
> >> target="_blank">+44 7788 592 806 | @fastchicken
> >> b. http://www.fastchicken.co.nz/
> >> _______________________________________________
> >> MonoTouch mailing list
> >> [hidden email]
> >> http://lists.ximian.com/mailman/listinfo/monotouch
> >>
> >>
> >> ________________________________
> >> If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658406.html
> >> To unsubscribe from Crash related to UITableViewController /
> >> UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
> >> NAML
> >
> >
> >
> > ________________________________
> > View this message in context: Re: Crash related to UITableViewController
> /
> > UISearchDisplayController in MonoTouch/Xamarin.iOS
> >
> > Sent from the MonoTouch mailing list archive at Nabble.com.
> >
> > _______________________________________________
> > MonoTouch mailing list
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=4658408&i=1>
> > http://lists.ximian.com/mailman/listinfo/monotouch
> >
>
>
>
> --
> Nic Wise
> t. +44 7788 592 806 | @fastchicken
> b. http://www.fastchicken.co.nz/
> _______________________________________________
> MonoTouch mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=4658408&i=2>
> http://lists.ximian.com/mailman/listinfo/monotouch
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658408.html
> To unsubscribe from Crash related to UITableViewController /
> UISearchDisplayController in MonoTouch/Xamarin.iOS, click
> here<http://monotouch.2284126.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4658405&code=bm9yZG1hcmsuZGFuaWVsQGdtYWlsLmNvbXw0NjU4NDA1fDk0ODk5NDMwMg==>
> .
> NAML<http://monotouch.2284126.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context:
http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658409.html
Sent from the MonoTouch mailing list archive at Nabble.com._______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch