Commit Graph

6 Commits

Author SHA1 Message Date
Mitchell Hashimoto
7db8346fca apprt/gtk: fix SIGSEGV on ImGui GLArea re-realize
Fixes #10406

ImGui_ImplOpenGL3_Shutdown() calls imgl3wShutdown() which dlcloses the
GL library handles but does not zero out the imgl3w function pointer
table (imgl3wProcs). When a GLArea is re-realized (e.g. during
reparenting), ImGui_ImplOpenGL3_Init() calls ImGui_ImplOpenGL3_InitLoader()
which checks "if (glGetIntegerv == nullptr)". Since the stale pointers
are non-null, it skips re-initialization. The next GL call through a
dangling function pointer causes a SIGSEGV.

Fix this by introducing ImGui_ImplOpenGL3_ShutdownWithLoaderCleanup()
which calls the normal shutdown and then zeroes the imgl3wProcs table,
forcing the next Init to reload GL function pointers via imgl3wInit().

Also properly destroy the ImGui context and reset widget state in
glAreaUnrealize so re-realize starts clean. This was extra but was
probably leaking memory.
2026-02-25 15:25:22 -08:00
Mitchell Hashimoto
a25e91bb25 pkg/dcimgui: expose more private dockbuilder stuff 2026-01-31 08:47:13 -08:00
Mitchell Hashimoto
f2bc722a58 pkg/dcimgui: fix wchar size mismatch 2025-12-31 13:36:40 -08:00
Mitchell Hashimoto
896361f426 Fix up API calls for initialization 2025-12-31 13:01:28 -08:00
Mitchell Hashimoto
978400b0b0 replace cimgui with dcimgui 2025-12-31 10:42:10 -08:00
Mitchell Hashimoto
3bd898603a pkg/dcimgui: DearBindings-based Imgui support 2025-12-31 10:11:43 -08:00