Event: Store device as weak pointer

This commit is contained in:
Kyle Schwarz
2026-06-02 17:19:23 -04:00
parent 476b5ff35c
commit bb711ae7e2
4 changed files with 25 additions and 16 deletions
+2 -2
View File
@@ -87,7 +87,7 @@ class DeviceExtension;
typedef uint64_t MemoryAddress;
class Device {
class Device : public std::enable_shared_from_this<Device> {
public:
virtual ~Device();
@@ -930,7 +930,7 @@ protected:
virtual device_eventhandler_t makeEventHandler() {
return [this](APIEvent::Type type, APIEvent::Severity severity) {
EventManager::GetInstance().add(type, severity, this);
EventManager::GetInstance().add(type, severity, weak_from_this());
};
}