[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
1 changed files with 6 additions and 1 deletions
|
@ -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