8000 Fix mismatched ImGui::Alloc/Free by AaronLieberman · Pull Request #1 · sammyfreg/netImgui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix mismatched ImGui::Alloc/Free #1

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

Closed

Conversation

AaronLieberman
Copy link
Contributor

The socket was being allocated with ImGui::MemAlloc but being freed with delete. When overriding the ImGui allocators, this mismatch causes a crash during disconnection.

The socket was being allocated with ImGui::MemAlloc but being freed with delete. When overriding the ImGui allocators, this mismatch causes a crash during disconnection.
@sammyfreg
Copy link
Owner
sammyfreg commented Jun 20, 2020

The socket is allocated using ImGui::MemAlloc inside a placement new. The fix is missing manually calling the destructor of SocketInfo and then Imgui::MemFree.

I will replace both the new( ImGui::MemMalloc )/delete, with netImguiNew/netImguiDelete like used everywhere else.

@AaronLieberman
Copy link
Contributor Author

Good point, I was focused on the memory and forgot about the destructor. Replacing with your standard way of doing it sounds great, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0