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.
Use this to replace the ViewController in a new XM project.
XM Version: 184.108.40.206
NSZombieEnabled indicates the issue is [NSWindow retainCount]
It looks like the issue here may be NSWindow.ReleaseWhenClosed defaulting to true.
Sorry, bad gist link. It's actually https://gist.github.com/mhutch/6a372cea19fab93df18ee99df5f4941c
If you use my favorite GC helper method:
new System.Threading.Thread (() =>
it crashes in one button press.
Looking into it now.
It appears that windows allocated via new NSWindow () differ both from windows rehydrated from storyboards and those created via an NSWindowController.
Creation Initial ReleasedWhenClosed state
new NSWindow () True
Storyboard AwakeFromNib False
new NSWindowController() / .Window False
Unfortunately there are a number of places where the "default" settings a newly init'ed Cocoa objects give are less than optimal, and this is the worst by far.
We could hack NSWindow's init constructors to set ReleasedWhenClosed = false, but I'm somewhat fearful of backwards compatibility.
We could protect it with a global flag, just like NSApplication.CheckForIllegalCrossThreadCalls, when we changed behavior.
In any case, setting ReleasedWhenClosed = false "fixes" things.
Fixed the 95% use case new NSWindow () with:
If we get more reports of xib files with this set, we can look into more complicated fixes for those.
I am able to reproduce this issue with X.mac xamarin.mac-220.127.116.11. However with latest C9 X.mac its working fine, NS window is not getting crashed. Here is the screencast for the same: http://www.screencast.com/t/LJy9hWVvIO
Hence closing this issue.
latest C9 X.mac is 18.104.22.168