Skip to content

Commit

Permalink
Use shared_ptr instead of unique_ptr for WpaEventHandler.
Browse files Browse the repository at this point in the history
  • Loading branch information
abeltrano committed Jul 2, 2024
1 parent 201d04c commit d7d3f5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/linux/wpa-controller/Hostapd.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Hostapd::Hostapd(std::string_view interfaceName) :
throw HostapdException("Failed to create hostapd event handler control socket connection");
}

auto eventHandler{ std::make_unique<WpaEventHandler>(std::move(controlSocketConnection), WpaType::Hostapd) };
auto eventHandler{ std::make_shared<WpaEventHandler>(std::move(controlSocketConnection), WpaType::Hostapd) };
if (!eventHandler) {
throw HostapdException("Failed to create hostapd event handler");
}
Expand Down
2 changes: 1 addition & 1 deletion src/linux/wpa-controller/include/Wpa/Hostapd.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ private:
WpaController m_controller;
std::unique_ptr<WpaControlSocketConnection> m_eventHandlerControlSocketConnection{ nullptr };
std::shared_ptr<WpaEventListenerProxy> m_eventListenerProxy;
std::unique_ptr<WpaEventHandler> m_eventHandler{ nullptr };
std::shared_ptr<WpaEventHandler> m_eventHandler{ nullptr };
WpaEventListenerRegistrationToken m_eventHandlerRegistrationToken{};
};
} // namespace Wpa
Expand Down

0 comments on commit d7d3f5c

Please sign in to comment.