Fix crash on startup on Oculus driver

This commit is contained in:
mcc 2021-03-05 17:17:07 -05:00 committed by Bjorn
parent 6de00cf2b8
commit 4bed6f6834
1 changed files with 3 additions and 0 deletions

View File

@ -83,6 +83,8 @@ static ovrInputState *refreshButtons(void) {
}
static bool oculus_init(float supersample, float offset, uint32_t msaa) {
arr_init(&state.textures, realloc);
ovrResult result = ovr_Initialize(NULL);
if (OVR_FAILURE(result)) {
return false;
@ -112,6 +114,7 @@ static void oculus_destroy(void) {
for (size_t i = 0; i < state.textures.length; i++) {
lovrRelease(state.textures.data[i], lovrTextureDestroy);
}
arr_free(&state.textures);
map_free(&state.textureLookup);
if (state.mirror) {