britzl / extension-imgui

Dear ImGUI extension for Defold
MIT License
58 stars 19 forks source link

imgui.scale_all_sizes crush #46

Closed zendorx closed 5 months ago

zendorx commented 5 months ago

Using scalle_all_sizes method crashes app

Assertion failed: (g.Style.WindowMinSize.x >= 1.0f && g.Style.WindowMinSize.y >= 1.0f && "Invalid style setting."), function ErrorCheckNewFrameSanityChecks, file imgui.cpp, line 7060.
INFO:CRASH: Successfully wrote Crashdump to file: /Users/ds/Library/Application Support/Defold/_crash
ERROR:CRASH: CALL STACK:

# 0 pc     0x37f284 dmengine _ZN7dmCrashL7HandlerEiP9__siginfoPv+36
# 1 pc     0x2c8c1d libxpc.dylib _sigtramp+29
# 2 pc     0x26630f libxpc.dylib __pthread_kill+11
# 3 pc     0x29df7b libxpc.dylib pthread_kill+263
# 4 pc     0x1e7ca5 libxpc.dylib abort+123
# 5 pc     0x1e6fbe libxpc.dylib err+0
# 6 pc     0x44fac3 dmengine _ZN5ImGui8NewFrameEv.cold.10+35
# 7 pc      0x38d9e dmengine _ZN5ImGui8NewFrameEv+17390
# 8 pc      0x119b0 dmengine _ZL22imgui_BeginMainMenuBarP9lua_State+96
# 9 pc     0x269d86 dmengine lj_BC_FUNCC+68
#10 pc     0x28333b dmengine lua_pcall+155
#11 pc     0x24c375 dmengine _ZN8dmScriptL13PCallInternalEP9lua_Stateiii+85
#12 pc     0x102ba1 dmengine _ZN12dmGameObject9RunScriptEP9lua_StatePNS_6ScriptENS_14ScriptFunctionEPNS_14ScriptInstanceERKNS_15RunScriptParamsE+369
#13 pc     0x102ece dmengine _ZN12dmGameObjectL24CompScriptUpdateInternalERKNS_22ComponentsUpdateParamsENS_14ScriptFunctionERNS_22ComponentsUpdateResultE+158
#14 pc     0x10d479 dmengine _ZN12dmGameObject6UpdateEPNS_16CollectionHandleEPKNS_13UpdateContextE+473
#15 pc      0xb4f0d dmengine _ZN8dmEngine4StepEPNS_6EngineE+1181
#16 pc      0xb55ca dmengine _Z14dmEngineUpdatePN8dmEngine6EngineE+26
#17 pc      0xb627d dmengine _ZN8dmEngine7RunLoopEPKNS_13RunLoopParamsE+109
#18 pc      0xb6151 dmengine _Z11engine_mainiPPc+113
#19 pc      0x42310 libobjc.A.dylib start+2432
zendorx commented 5 months ago

Weird, it works in example.

zendorx commented 5 months ago

I put it on update by mistake and it cause crush. If put it in init methods it does not crush

britzl commented 5 months ago

I'm closing this issue. I'm not sure if there's much point trying to gracefully deal with these kinds of programmer errors.

zendorx commented 5 months ago

I am not sure is it programmer error. I think it should be possible to set scale dynamicly, for example when window resizes. I think this crush related for some leaks in c++ code. But maybe I am wrong

zendorx commented 5 months ago

Calling imgui.scale_all_sizes several times increasing size, like scale applied several times. There should be some reset style method to use it properly. And thats why it is crushing when call it in update.