[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:
thefiddler 2014-09-23 08:55:02 +02:00
parent 7829fa66b7
commit e621b21c88

View file

@ -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);