mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-10 19:03:30 +00:00
Exception when collapse window with ListBox #3687
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#3687
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Version: v1.79
Branch: master
OS: Windows 10
Compiler: VS2019
When i try to collapse window with ListBox in it:
"An unhandled exception was thrown: read access violation.
parent_window was nullptr."
Shown example:
Try:
It works, but this adds one more strange 'If' to program, also if you have control for open/close of imgui window you will need control for imgui::end too, because you can not open window and this will throw error to too much ::ends. So i think that shouldn't work like you suggested.
It's not a "strange if", this is how you are supposed to use the
Begin()function.Either way, if you look at the description for
ListBoxHeader()it says:"if the function return true, you can output elements then call ListBoxFooter() afterwards."
And if you look for usage of
ListBoxHeader()anywhere in the codebase you'll find that every single use of it is testing the return value. So you should at least do:I have reworked the code in
ListBoxFooter()to more properly assert with a message to help guide future users.