Merge pull request #319 from alloverse/fix/lodr-headset-nil

on lodr restart, make sure lovr.headset is nil'd if none is available
This commit is contained in:
Bjorn 2020-11-20 08:56:57 -07:00 committed by GitHub
commit 1b4a97035a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -142,9 +142,8 @@ static int l_lovrHeadsetInit(lua_State* L) {
lua_pop(L, 1);
}
if (lovrHeadsetInit(drivers, driverCount, supersample, offset, msaa)) {
luax_atexit(L, lovrHeadsetDestroy);
}
luax_atexit(L, lovrHeadsetDestroy); // Always make sure the headset module gets cleaned up
lovrHeadsetInit(drivers, driverCount, supersample, offset, msaa);
lua_pop(L, 2);
return 0;