-
Notifications
You must be signed in to change notification settings - Fork 54
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
Multiple calls of ConnectFromApp results in multiple contextHooks being added #37
Labels
bug
Something isn't working
Comments
Thank you for the report. Should be easy enough to fix. |
Which version of NetImgui are you using? |
sammyfreg
added a commit
that referenced
this issue
Aug 20, 2022
Issue has been fixed: 74d0be3 Normally, the hook cleanup happen in |
sammyfreg
added a commit
that referenced
this issue
May 4, 2023
* Bugfix #37 Fix multiple Context Hook callback added to Imgui context, after a reconnect. * Prevent Server from saving a imgui.ini file This could conflict with other imgui application in same folder, and the Server doesn't really need any Imgui settings saved * Fixes for Linux build -Invalid GPU resource release on Com Thread -TextureId cast error -Unneeded Windows specific include * Fix some textureid cast error on GCC * Socket 'Force Listen' now optional Default is unused. Prevents having 2 running NetImgui Servers listening on same port. Seems like the 'force listen' isn't needed on Windows/Linux, but can still toggle it on if needed. * Updated for Dear ImGui 1.89 support -Small changes done to inputs * OffsetPointer fix Possible error for platorm using top bit in 64bits in VirtualAddress space * Removed 'unused const' warning introduced in VisualStudio 17.4.4 Fix the CI * Revert to wrongly submitted loader file during last Dear ImGui backend update * Upgrade DearImgui 1.89.5 * Version 1.9 Release * Update msbuild_vs2022_dev.yml updated msbuild setup * Update msbuild_vs2022_dev.yml Update to dotnet installed (needed for sharpmake) * Update msbuild_vs2022_dev.yml * Update msbuild_vs2022_dev.yml * Update msbuild_vs2022_dev.yml
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey Sammy, I love what you've done with netImgui, but I think I've found a bug.
Whenever
ConnectFromApp()
is called, itDisconnects()
and then reconnects and callsclient.ContextInitialize()
which adds a new context hook (if NETIMGUI_IMGUI_CALLBACK_ENABLED is defined). Currently, the Disconnect doesn't remove the hook, so we end up with a new hook being added every timeConnectFromApp()
is called.You can repro this by running a client, connecting to a server then shutting the server down and then starting it and reconnecting. Every time you do this, a new hook is added and the result is that the server only displays a valid update once every 'N' frames.
Checking
mhImguiHookNewframe
inContextInitialize()
and only adding a new hook if it's zero works, as should removing the hook in Disconnect() (currently the destructor for ClientInfo is the only place that removes the hook.)The text was updated successfully, but these errors were encountered: