mirror of
https://github.com/ocornut/imgui.git
synced 2025-02-02 12:37:20 +01:00
Backends: Metal: Fixed resource leak when using multiple contexts. (#7419)
This commit is contained in:
parent
2f1194a296
commit
d0021e1621
@ -306,17 +306,14 @@ void ImGui_ImplMetal_RenderDrawData(ImDrawData* drawData, id<MTLCommandBuffer> c
|
|||||||
indexBufferOffset += (size_t)draw_list->IdxBuffer.Size * sizeof(ImDrawIdx);
|
indexBufferOffset += (size_t)draw_list->IdxBuffer.Size * sizeof(ImDrawIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__block MetalContext* sharedMetalContext = bd->SharedMetalContext;
|
||||||
[commandBuffer addCompletedHandler:^(id<MTLCommandBuffer>)
|
[commandBuffer addCompletedHandler:^(id<MTLCommandBuffer>)
|
||||||
{
|
{
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
ImGui_ImplMetal_Data* bd = ImGui_ImplMetal_GetBackendData();
|
@synchronized(bd->SharedMetalContext.bufferCache)
|
||||||
if (bd != nullptr)
|
|
||||||
{
|
{
|
||||||
@synchronized(bd->SharedMetalContext.bufferCache)
|
[sharedMetalContext.bufferCache addObject:vertexBuffer];
|
||||||
{
|
[sharedMetalContext.bufferCache addObject:indexBuffer];
|
||||||
[bd->SharedMetalContext.bufferCache addObject:vertexBuffer];
|
|
||||||
[bd->SharedMetalContext.bufferCache addObject:indexBuffer];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}];
|
}];
|
||||||
|
@ -64,6 +64,7 @@ Other changes:
|
|||||||
- Misc: Fixed misc/cpp/imgui_stdlib.h/.cpp not supporting IMGUI_DISABLE. (#8294) [@juur]
|
- Misc: Fixed misc/cpp/imgui_stdlib.h/.cpp not supporting IMGUI_DISABLE. (#8294) [@juur]
|
||||||
- Backends: Allegro5: Avoid calling al_set_mouse_cursor() repeatedly since it appears
|
- Backends: Allegro5: Avoid calling al_set_mouse_cursor() repeatedly since it appears
|
||||||
to leak on on X11 (#8256). [@Helodity]
|
to leak on on X11 (#8256). [@Helodity]
|
||||||
|
- Backends: Metal: Fixed resource leak when using multiple contexts. (#7419) [@anszom]
|
||||||
- Backends: Vulkan: Fixed setting VkSwapchainCreateInfoKHR::preTransform for
|
- Backends: Vulkan: Fixed setting VkSwapchainCreateInfoKHR::preTransform for
|
||||||
platforms not supporting VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR. (#8222) [@Zer0xFF]
|
platforms not supporting VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR. (#8222) [@Zer0xFF]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user