Skip to content

Commit

Permalink
layers: Fix IMAGE_STATE::Unlink() for swapchain images
Browse files Browse the repository at this point in the history
Since these images are only destroyed when the swapchain is
destroyed, calling RemoveParent on it is unnecessary and can
cause the parent_nodes_ set to be corrupted.
  • Loading branch information
jeremyg-lunarg committed Oct 25, 2021
1 parent bb63d68 commit 3be7454
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion layers/image_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,9 @@ void SWAPCHAIN_NODE::AcquireImage(uint32_t image_index) {
void SWAPCHAIN_NODE::Destroy() {
for (auto &swapchain_image : images) {
if (swapchain_image.image_state) {
RemoveParent(swapchain_image.image_state);
swapchain_image.image_state->Destroy();
dev_data->imageMap.erase(swapchain_image.image_state->image());
swapchain_image.image_state = nullptr;
}
// NOTE: We don't have access to dev_data->fake_memory.Free() here, but it is currently a no-op
}
Expand Down

0 comments on commit 3be7454

Please sign in to comment.