Crashed when Render(EndFrame)


excuse me for asking this question.

the application is using DirectX9 and it was used Dear Imgui 1.53 version before,
today I update to latest version,
and change somewhere needed to update (Create/DestroyContext)
and compile seems anything fine,
but start the application it was crashing at ImGui::Render();

in version 1.53 always crashed cause “Expression: *p_backup == current && ‘PushStyleVar/PopStyleVar Mismatch!’”

here is the Render crash point,

could you help me please?
thank you!

Hello Alice,

It looks like the call to io.ImeSetInputScreenPosFn threw an exception.
Normally io.ImeSetInputScreenPosFn should point to ImeSetInputScreenPosFn_DefaultImpl() unless you have set it yourself.

I think we need more details to understand it.

in version 1.53 always crashed cause “Expression: *p_backup == current && ‘PushStyleVar/PopStyleVar Mismatch!’”

This happens if you haven’t balanced your PushStyleVar and PopStyleVar correctly!

1 Like

Thank you for your answering Ocornut,really helpful!

The problem in the Dear ImGui 1.53 was solved,
thank you so much!

but in 1.64 still crashed,
I don’t set the value of ImeWindowHandle this time,
and the crash of ImeSetInputScreenPosFn was passed now,
but it will crash at here:

    if (g.DrawData.CmdListsCount > 0 && g.IO.RenderDrawListsFn != NULL)
    g.IO.RenderDrawListsFn(&g.DrawData); << here

I missed some important settings?

Thank you for helping!

okay,seems that possibly caused I used 2 newframe at the same time…
one for chat window,one for dialog likes pop up window,

and there is a input box within chat window render,
they both working but dialog windows can only showing,
it could not be clicking,
and the mouse,. IsAnyWindowHovered() for mouse with chat window and input box always give me 1,
but with dialog windows give me 0,

I saw the some issues and docs,I will try to fix it.
Thank you Ocornut!


1 Like