mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-05-11 20:12:14 +00:00
[Win] Avoid NRE in WinFactory.Dispose()
WinFactory.Dispose() could crash with a NRE when the joystick driver has not been initialized. Fixed by checking for null before disposing the input driver.
This commit is contained in:
parent
7829fa66b7
commit
e621b21c88
|
@ -163,7 +163,12 @@ namespace OpenTK.Platform.Windows
|
||||||
{
|
{
|
||||||
if (manual)
|
if (manual)
|
||||||
{
|
{
|
||||||
rawinput_driver.Dispose();
|
WinRawInput raw = rawinput_driver;
|
||||||
|
if (raw != null)
|
||||||
|
{
|
||||||
|
raw.Dispose();
|
||||||
|
rawinput_driver = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
base.Dispose(manual);
|
base.Dispose(manual);
|
||||||
|
|
Loading…
Reference in a new issue