fix event_bus_test

This commit is contained in:
tqcq
2024-04-03 18:04:14 +08:00
parent 35e01dccd2
commit bf1584c750
2 changed files with 3 additions and 1 deletions

View File

@@ -148,6 +148,8 @@ public:
}
}
EventBus *operator->() { return this; }
private:
sled::Mutex mutex_;
std::unordered_map<std::type_index, std::function<void(EventBus *)>> cleanup_handlers_ GUARDED_BY(mutex_);

View File

@@ -89,7 +89,7 @@ TEST_SUITE("EventBus")
std::atomic<int> &data;
};
struct AotmicEventSubscriber : public sled::EventBus::Subscriber {
struct AotmicEventSubscriber : public sled::EventBus::Subscriber<> {
virtual ~AotmicEventSubscriber() = default;
void OnEvent(AtomicEvent event) { event.data.fetch_add(1); }