try fixing leak
This commit is contained in:
parent
ee6851b8f4
commit
7f765fc0a4
|
@ -164,6 +164,9 @@ bool ImGui_ImplMetal_NewFrame(MTLRenderPassDescriptor* renderPassDescriptor)
|
||||||
{
|
{
|
||||||
ImGui_ImplMetal_Data* bd = ImGui_ImplMetal_GetBackendData();
|
ImGui_ImplMetal_Data* bd = ImGui_ImplMetal_GetBackendData();
|
||||||
IM_ASSERT(bd->SharedMetalContext != nil && "No Metal context. Did you call ImGui_ImplMetal_Init() ?");
|
IM_ASSERT(bd->SharedMetalContext != nil && "No Metal context. Did you call ImGui_ImplMetal_Init() ?");
|
||||||
|
if (bd->SharedMetalContext.framebufferDescriptor != nil) {
|
||||||
|
[bd->SharedMetalContext.framebufferDescriptor release];
|
||||||
|
}
|
||||||
bd->SharedMetalContext.framebufferDescriptor = [[FramebufferDescriptor alloc] initWithRenderPassDescriptor:renderPassDescriptor];
|
bd->SharedMetalContext.framebufferDescriptor = [[FramebufferDescriptor alloc] initWithRenderPassDescriptor:renderPassDescriptor];
|
||||||
|
|
||||||
if (bd->SharedMetalContext.depthStencilState == nil)
|
if (bd->SharedMetalContext.depthStencilState == nil)
|
||||||
|
@ -233,6 +236,7 @@ void ImGui_ImplMetal_RenderDrawData(ImDrawData* drawData, id<MTLCommandBuffer> c
|
||||||
id<MTLRenderPipelineState> renderPipelineState = ctx.renderPipelineStateCache[ctx.framebufferDescriptor];
|
id<MTLRenderPipelineState> renderPipelineState = ctx.renderPipelineStateCache[ctx.framebufferDescriptor];
|
||||||
if (renderPipelineState == nil)
|
if (renderPipelineState == nil)
|
||||||
{
|
{
|
||||||
|
printf("RPS NULL....\n");
|
||||||
// No luck; make a new render pipeline state
|
// No luck; make a new render pipeline state
|
||||||
renderPipelineState = [ctx renderPipelineStateForFramebufferDescriptor:ctx.framebufferDescriptor device:commandBuffer.device];
|
renderPipelineState = [ctx renderPipelineStateForFramebufferDescriptor:ctx.framebufferDescriptor device:commandBuffer.device];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue