Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/test/test_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ class Unit {
// Something has gone wrong. Forcibly close down both sides.
void on_request_deadline() {
fprintf(stderr, "Request did not finish by deadline\n");
delete this;
delete other_;
delete this;
}

private:
Expand Down
8 changes: 4 additions & 4 deletions src/timer-wheel.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,17 @@ class TimerEventInterface {
template<typename CBType>
class TimerEvent : public TimerEventInterface {
public:
explicit TimerEvent<CBType>(const CBType& callback)
: callback_(callback) {
explicit TimerEvent(CBType callback)
: callback_(std::move(callback)) {
}

void execute() {
callback_();
}

private:
TimerEvent<CBType>(const TimerEvent<CBType>& other) = delete;
TimerEvent<CBType>& operator=(const TimerEvent<CBType>& other) = delete;
TimerEvent(const TimerEvent& other) = delete;
TimerEvent& operator=(const TimerEvent& other) = delete;
CBType callback_;
};

Expand Down