Use shared_ptr for devices in DeviceMonitor

This commit is contained in:
pixl
2020-06-17 04:15:00 -04:00
parent 6b895b3015
commit 91954e8a73
5 changed files with 17 additions and 18 deletions
+2 -2
View File
@@ -44,7 +44,7 @@ namespace hidpp
void listen(); // Runs asynchronously
void stopListening();
void addEventHandler(const std::string& nickname, EventHandler& handler);
void addEventHandler(const std::string& nickname, const std::shared_ptr<EventHandler>& handler);
void removeEventHandler(const std::string& nickname);
Report sendReport(Report& report);
@@ -56,7 +56,7 @@ namespace hidpp
DeviceIndex index;
uint8_t supported_reports;
std::map<std::string, EventHandler> event_handlers;
std::map<std::string, std::shared_ptr<EventHandler>> event_handlers;
};
} } }