openvr
openvr copied to clipboard
Memory leak in GetOverlayTextureSize()
There's a memory leak in GetOverlayTextureSize().
To reproduce, run the following code and watch Windows Task Manager. Tested with SteamVR 1.20.2 and and 1.21.2 beta.
uint32_t nWidth, nHeight;
vr::VROverlayError err;
vr::VROverlayHandle_t handle;
err = vr::VROverlay()->FindOverlay("system.HeadsetView", &handle); // Use any overlay. I'm using system.HeadsetView because a valid handle is needed.
for (int i = 0; i < 1000000; i++)
err = vr::VROverlay()->GetOverlayTextureSize(handle, &nWidth, &nHeight);