Don't use std::make_unique right before release

This commit is contained in:
Jacek Galowicz 2023-11-02 15:52:53 +01:00
parent 9d9f42cc38
commit 8ae3aeec94

View file

@ -179,7 +179,7 @@ std::unique_ptr<InterruptCallback> createInterruptCallback(std::function<void()>
auto token = interruptCallbacks->nextToken++; auto token = interruptCallbacks->nextToken++;
interruptCallbacks->callbacks.emplace(token, callback); interruptCallbacks->callbacks.emplace(token, callback);
auto res = std::make_unique<InterruptCallbackImpl>(); std::unique_ptr<InterruptCallbackImpl> res {new InterruptCallbackImpl{}};
res->token = token; res->token = token;
return std::unique_ptr<InterruptCallback>(res.release()); return std::unique_ptr<InterruptCallback>(res.release());