mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-09-17 01:17:15 +00:00
[Mac] Don't let exceptions escape to unmanaged code
This commit is contained in:
parent
892d129e54
commit
4c7f6a92a7
|
@ -143,6 +143,8 @@ namespace OpenTK.Platform.MacOS
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceAdded(IntPtr context, IOReturn res, IntPtr sender, IOHIDDeviceRef device)
|
void DeviceAdded(IntPtr context, IOReturn res, IntPtr sender, IOHIDDeviceRef device)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
bool recognized = false;
|
bool recognized = false;
|
||||||
|
|
||||||
|
@ -181,8 +183,15 @@ namespace OpenTK.Platform.MacOS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("[Mac] Exception in managed callback: {0}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DeviceRemoved(IntPtr context, IOReturn res, IntPtr sender, IOHIDDeviceRef device)
|
void DeviceRemoved(IntPtr context, IOReturn res, IntPtr sender, IOHIDDeviceRef device)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
bool recognized = false;
|
bool recognized = false;
|
||||||
|
|
||||||
|
@ -213,8 +222,15 @@ namespace OpenTK.Platform.MacOS
|
||||||
NativeMethods.IOHIDDeviceUnscheduleFromRunLoop(device, RunLoop, InputLoopMode);
|
NativeMethods.IOHIDDeviceUnscheduleFromRunLoop(device, RunLoop, InputLoopMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("[Mac] Exception in managed callback: {0}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DeviceValueReceived(IntPtr context, IOReturn res, IntPtr sender, IOHIDValueRef val)
|
void DeviceValueReceived(IntPtr context, IOReturn res, IntPtr sender, IOHIDValueRef val)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (disposed)
|
if (disposed)
|
||||||
{
|
{
|
||||||
|
@ -243,6 +259,11 @@ namespace OpenTK.Platform.MacOS
|
||||||
//Debug.Print ("Device {0:x} not found in list of keyboards or mice", sender);
|
//Debug.Print ("Device {0:x} not found in list of keyboards or mice", sender);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("[Mac] Exception in managed callback: {0}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region Mouse
|
#region Mouse
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue