release VK_INSTANCE_LAYERS in enable_correct_layers_from_settings - #1985
Merged
charles-lunarg merged 1 commit intoJul 27, 2026
Merged
Conversation
|
Author aizu-m not on autobuild list. Waiting for curator authorization before starting CI build. |
1 similar comment
|
Author aizu-m not on autobuild list. Waiting for curator authorization before starting CI build. |
|
CI Vulkan-Loader build queued with queue ID 55743. |
charles-lunarg
approved these changes
Jul 27, 2026
|
CI Vulkan-Loader build # 3658 running. |
|
CI Vulkan-Loader build # 3658 passed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Was tracing
loader_getenv/loader_free_getenvpairing through the settings-file layer path. OnevkCreateInstancewithVK_INSTANCE_LAYERSset:Two acquires, no release.
settings.c:1163reads the env var and theout:label just returnsres. On Windowsloader_getenvhands back aloader_instance_heap_allocbuffer, so that read is owned by the caller. On unix it is plaingetenvand nothing is leaked, which is why this stayed quiet.Two calls because this is the settings-file branch of layer selection, reached from both
loader_enable_instance_layersandloader_validate_instance_extensions. Both of those already release their ownENABLED_LAYERS_ENVread atloader.c:4758andloader.c:5732. The callee was missed, so the string leaks once per call for as long as the process keeps creating instances.Swept every
loader_getenv/loader_secure_getenvsite in the loader. This is the only unpaired one.get_unix_settings_pathreads four XDG vars without releasing them but is unix-only, where the free is a no-op, so I left it alone.The test asserts allocator balance for a settings file with an active layer configuration plus
VK_INSTANCE_LAYERS. It only detects the leak on Windows, since that is the only platform where the read allocates.