Crow
Crow copied to clipboard
Fix example-chat
example-chat has runtime errors because std::function<> is assigned null in places.
This is a fix for that, with unittests.
What is the exact error? As far as I see in the code, these handlers are checked for null before calling them. Maybe problem is with example?
> What is the exact error? As far as I see in the code, these handlers are checked for null before calling them. Maybe problem is with example?
The application crashes, segfaults. I ran it on Android 15 under Termux (clang) and Linux (probably clang again) where it crashed.
Using gdb, the crash is caused by assigning null to a std::function.
The crash can be reproduced on Lunux by compiling with clang and just using example-chat, the faulty code is in Crow, not the example.
The check for null isn't the problem, it's assigning null that's the problem.
Ok, thanks for info. So the only thing is that you can create lambda_wrapper with nullptr.