From e4d313d8b1d75319dac17aa6d92a57a20e3189c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20H=C3=B6glinger-Stelzer?= Date: Tue, 23 Apr 2019 21:34:36 +0200 Subject: [PATCH] Sylveonification, almost --- src/NotificationRequestPool.cpp | 7 +++---- src/NotificationRequestPool.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/NotificationRequestPool.cpp b/src/NotificationRequestPool.cpp index 4624fb4..6bcf909 100644 --- a/src/NotificationRequestPool.cpp +++ b/src/NotificationRequestPool.cpp @@ -21,12 +21,11 @@ NotificationRequestPool::NotificationRequestPool( // create auto-reset event wait_handle = CreateEvent(nullptr, FALSE, FALSE, nullptr); // create async pending I/O request wrapper - auto req = new XusbNotificationRequest( + requests_.push_back(std::make_unique( client_->hBusDevice, target_->SerialNo, wait_handle - ); - requests_.push_back(req); + )); } // init ASIO @@ -87,7 +86,7 @@ void NotificationRequestPool::operator()() // index of the request which just got completed const auto index = ret - WAIT_OBJECT_0; // grab associated request - const auto req = requests_[index]; + const auto req = requests_[index].get(); // prepare queueing library caller notification callback const boost::function requests_; + std::vector> requests_; std::shared_ptr thread_; boost::mutex m_; boost::condition_variable cv_;