Skip to content

Commit

Permalink
Clean up swapchains properly with xrDestroySwapchain
Browse files Browse the repository at this point in the history
  • Loading branch information
Youngbok Shin authored and BastiaanOlij committed Mar 16, 2022
1 parent c38e12e commit 244d637
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/openxr/OpenXRApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2153,6 +2153,11 @@ bool OpenXRApi::initialiseSwapChains() {

void OpenXRApi::cleanupSwapChains() {
if (swapchains != NULL) {
for (uint32_t i = 0; i < view_count; i++) {
if (swapchains[i] != XR_NULL_HANDLE) {
xrDestroySwapchain(swapchains[i]);
}
}
free(swapchains);
swapchains = NULL;
}
Expand Down

0 comments on commit 244d637

Please sign in to comment.