openvr icon indicating copy to clipboard operation
openvr copied to clipboard

Memory leak in GetOverlayTextureSize()

Open Raivr-dev opened this issue 4 years ago • 0 comments

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);


Raivr-dev avatar Nov 19 '21 00:11 Raivr-dev