Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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.
  • Loading branch information
thefiddler committed Sep 23, 2014
1 parent 7829fa6 commit e621b21
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/OpenTK/Platform/Windows/WinFactory.cs
Expand Up @@ -163,7 +163,12 @@ protected override void Dispose(bool manual)
{
if (manual)
{
rawinput_driver.Dispose();
WinRawInput raw = rawinput_driver;
if (raw != null)
{
raw.Dispose();
rawinput_driver = null;
}
}

base.Dispose(manual);
Expand Down

0 comments on commit e621b21

Please sign in to comment.