gelldur / EventBus

A lightweight and very fast event bus / event framework for C++17
Apache License 2.0
371 stars 81 forks source link

Crash when used across DLL boundaries #44

Closed gamagan closed 2 years ago

gamagan commented 2 years ago

Describe the bug This library doesn't work correctly when used across DLL boundaries. It's likely related to the code used to generate the Event ids.

void Bus::listen(...) {
    constexpr auto eventID = internal::event_id<Event>()
}

That eventID will be different between EXE and DLL

To Reproduce

Expected behavior Not to crash.

Build:

Additional context This particular usecase is an EXE that dynamically loads DLLs. The EXE provides the DLLs pointers to the bus/listener so the DLLs can subscribe to and send events.