KhronosGroup / OpenXR-SDK-Source

Sources for OpenXR loader, basic API layers, and example code.
https://khronos.org/openxr
Apache License 2.0
680 stars 251 forks source link

Child handles not destroyed on parent destruction #29

Closed rpavlik closed 4 years ago

rpavlik commented 5 years ago

I wrote some test utilities that register a debug utils messenger to provide extra info. I don't keep it around because I was relying on the "parent handle destruction implies child handle destruction" behavior, but it appears that's not the case, at least for this handle type.

As a demonstration, I have a static uintptr_t variable in the function that creates and registers the debug messenger, which gets incremented with each call and is passed as the userData parameter. My callback then prints the userdata param (cast back to an integer) at the beginning of the line. After a few test cycles, here's some sample output showing all 21 debug messengers are still active.

1 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
2 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
3 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
4 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
5 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
6 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
7 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
8 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
9 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
10 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
11 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
12 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
13 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
14 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
15 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
16 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
17 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
18 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
19 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
20 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
21 [G  ][Verbose][OpenXR-Loader       ][xrDestroyInstance               ] Completed loader trampoline
rpavlik-bot commented 4 years ago

An issue (number 1284) has been filed to correspond to this issue in the internal Khronos GitLab.

If you have a Khronos account, you can access that issue at KHR:openxr/openxr#1284.

rpavlik commented 4 years ago

Fixed in 1.0.7