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.
In testing my local fix for Bugzilla #41413, (change from using NSRunLoop.NSDefaultRunLoopMode to NSRunLoop.NSRunLoopCommonModes on OpenGLViewRenderer.cs line 101), I observed a crash in OpenGLViewRenderer.cs on line 96, when multiple OpenGLViewRenderers exist in the same app (eg. different Sub-views).
A View (the map in our app) instantiates a Xamarin.Forms OpenGLView (using OpenGLViewRenderer), then another View (a match-3 game on an overlaying view) instantiates a second OpenGLView. Around the time the 2nd view is instantiated, there is a Null Reference Exception on line 96 ("_displayLink.Invalidate()") of OpenGLViewRenderer.cs.
This can happen because the Dispose() method of OpenGLViewRenderer.cs is setting _displayLink to null (on line 45), but the run-loop may thereafter attempt to access the (nulled) _displayLink on line 96. If one adds a guard for null _displayLink to the condition of line 94, the problem no longer occurs:
BEFORE (line 94 of OpenGLViewRenderer.cs):
if (control == null || model == null || !model.HasRenderLoop)
AFTER, with null guard (line 94):
if ((control == null || model == null || !model.HasRenderLoop)&&(_displayLink!=null))
I think this adding this null guard on line 94 is one solution to this issue.
Should be fixed on 2.3.6-pre1