-
Notifications
You must be signed in to change notification settings - Fork 26
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
Callback from authentication request results in undefined behavior if Nakama client has been destroyed: #26
Comments
void RestClient::disconnect()
{
} We delete all requests in destructor and print warning: RestClient::~RestClient()
{
disconnect();
if (_reqContexts.size() > 0)
{
NLOG(NLogLevel::Warn, "Not handled %u request(s) detected.", _reqContexts.size());
for (RestReqContext* reqContext : _reqContexts)
{
delete reqContext;
}
_reqContexts.clear();
}
} So, it's not possible to receive callback after NClient is destroyed. |
I'll have to build a debug version of the dll to give you a stack, but I will do so at my earliest convenience. Why is it that disconnect does not destroy request contexts? That seems... unexpected? |
At first I did not implement disconnect because |
Okay. I had to hack a fix into the websocketpp library code to get a build that was usable, and there's a dependency on yasm not mentioned by the build-from-source docs for Nakama-cpp. Also, the
|
ugh, finally understood reason of crash and fixed it. |
btw what did you fixed in the websocketpp? |
I ran into zaphoyd/websocketpp#794 ... I threw up a diff hunk that shows what I changed. Can't tell if I ran into it because of the VS2019 compiler or what, didn't spend a ton of time on it, either, so it's possibly wildly broken. |
Looks like the latest in the |
Cool! Thanks for reporting the error 👍 |
After a call to authenticateDevice(), if the endpoint being connected to is slow (in my case, firewalled due to a security group configuration "bug"), and the NClient object is disconnect()ed and destroyed, I am still seeing what looks like a callback from within nakama-cpp.dll (I'm using the Unreal client, but have looked through the code enough to suspect the bug is here) will still fire. I cannot figure out how to cancel this outstanding auth request in a clean way, and I do not see code in this repo that does so either.
Thanks in advance for your time.
The text was updated successfully, but these errors were encountered: