-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
[BUG] Inconsistent Output in Demo #26
Comments
Hi, thank you for the bug report. Can you provide the entire error output as well as info on your configuration? What operating system are you using? |
Stock Ubuntu 20.04. The demo outputs the following:
So no first event message |
What compiler are you using? |
As already said - this works when pushing all the object to stack - but it is still do not works when passing by reference. The correct fix must work for both. As pushing the only object is somewhat ugly. P.S. I'm using gcc-11 and this needed to compile:
And there is compile warnings:
|
And there is design problem concerning return value of register_handler() - assuming you have the class:
The first problem is that if reg var is scope-auto-deleted - the handler will never invoke. I think that scope problems of return value can never affect the exact function. This is confusing behavior at least. |
In the demo, it was not passing by reference, it was passing a pointer of
Noted and fixed.
I do not see these warnings with GCC 11 on Ubuntu 20.04. Have you changed the compilation flags? |
CFLAGS are "-Wall -O2" |
The class test_class {
dp::handler_registration reg;
public:
test_class(dp::event_bus& bus) : reg(std::move(bus.register_handler<first_event>([](const first_event& evt) {
std::cout << "test class: " << evt.message << "\n";
}))) {
}
}; The registration will automatically de-register when |
Thanks, will try |
The first event is never printed. This is because following do not work:
but following works:
And test SIGSEGV's at aarch64 in DeregisterWhileDispatching
The text was updated successfully, but these errors were encountered: