Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Whenever we call
NSApplication.SharedApplication.BeginInvokeOnMainThread() we get:
"[NativeRelease ERROR]: type NSAsyncActionDispatcher ..."
It appears to be coming from here:
See attached simple example.
There was not attached simple example
Created attachment 2229 [details]
Apologies (Bugzilla sometimes seems to forget about my attachment on the initial post).
I'm having the same problem, so I did some investigation.
This seems to be related to:
What happens is this:
* You use NET 4.5 async await in your app. The callback goes through AppKitSynchronizationContext.Post() which calls NSRunLoop.Main.BeginInvokeOnMainThread().
* This creates a managed NSAsyncActionDispatcher, and Apply() disposes it when done.
* Some time later, native code uses that NSAsyncActionDispater(IntPtr) ctor to create a new instance - and when we call Dispose() on that one, we get the warning.
Unfortunately, I have no idea how to fix this, but I can help reproduce the issue if necessary.
Do you have a way to reproduce this problem? I am curious to find out who is calling into the NSActionDispatcher to reinstantiate the object, it should have been fully destroyed and used at that point.
I looked at Chris' sample and it was a harmless error.
Since the error reporting itself is useful to keep, instead I decided to change NSAsyncActionDispatcher to not commit suicide behind our runtime's back and not call Dispose.
The Dispose will be called later.
See Maccore #c5e5c5328d5d048bc329c2e74d9325a7cd059a63