-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MSVC compiler] Cleanup crash when having one OutPin connected with multiple InPin's #25
Comments
Thanks for the detailed issue. Also please note that in this minimal example, the end node will always return true, and it's also not taking advantage of the full potential of |
That is weird, I just moved to the non docking branch of imgui and that does not change anything. If you want to test that, I created a new branch in the repo. Also I switched to uids, but didn't change anything. Maybe something is wrong with my setup, but I would not know what. |
I recorded a demo of what is happening here, maybe it could help with understanding what is going wrong. cut-error-demostration.mp4 |
I have encountered the situation recently, too. I guess the root cause is that ImNodeFlow::m_nodes are destructed in any order when ImNodeFlow is destructing. Therefore, the instance of OutPin will be destructed before the Link. The problem has gone after I added:ImNodeFlow.h ~ImNodeFlow() { removeLinks(); }
void removeLinks(); ImNodeFlow.cpp void ImNodeFlow::removeLinks()
{
for (auto& itr : m_nodes) {
for (auto& inPin : itr.second->getIns()) {
inPin->deleteLink();
}
}
} Can you please see if this can solve your problem? |
What compiler are you using? |
Visual C++ 2022 17.10.3 Compiler: MSVC 19.40.33811.0 on Windows-10.0.19045 |
I've implemented something similar with the latest commit in the |
Version:
master branch
ImGui:
1.90.5-docking
Issue
Connecting a OutPin with 2 or more InPin's and then close the program. The deconstructor from ImFlow::Link produces a
"Access violation on reading location ..."
.One fix that I tried, was to replace
m_left
withm_right
but that seems to break other things, like the node deletion logic.Code
I minimized my code to be still functional and replicate the issue here. It is not the most good looking code, but should be readable enough.
Also, I added all c++ code in the spoilers following.
main.cpp
Window.h
Window.cpp
AndNode.h
AndNode.cpp
The text was updated successfully, but these errors were encountered: