mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-25 07:05:38 +00:00
Fix KeyNotFoundException in EventHandler routine.
This commit is contained in:
parent
9b3f1dc8ee
commit
14ea26c866
|
@ -217,8 +217,20 @@ namespace OpenTK.Platform.MacOS
|
|||
|
||||
protected static OSStatus EventHandler(IntPtr inCaller, IntPtr inEvent, IntPtr userData)
|
||||
{
|
||||
EventInfo evt = new EventInfo(inEvent);
|
||||
// bail out if the window passed in is not actually our window.
|
||||
if (mWindows.ContainsKey(userData) == false)
|
||||
return OSStatus.EventNotHandled;
|
||||
|
||||
WeakReference reference = mWindows[userData];
|
||||
|
||||
// bail out if the CarbonGLNative window has been garbage collected.
|
||||
if (reference.IsAlive == false)
|
||||
{
|
||||
mWindows.Remove(userData);
|
||||
return OSStatus.EventNotHandled;
|
||||
}
|
||||
|
||||
EventInfo evt = new EventInfo(inEvent);
|
||||
CarbonGLNative window = (CarbonGLNative)reference.Target;
|
||||
|
||||
//Debug.Print("Processing {0} event for {1}.", evt, window.window);
|
||||
|
|
Loading…
Reference in a new issue