Skip to content

Commit

Permalink
Clear buffer in correct place (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
awegrzyn authored May 28, 2021
1 parent 175977c commit 694e128
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif()

# Define project
project(Monitoring
VERSION 3.8.4
VERSION 3.8.5
DESCRIPTION "O2 Monitoring library"
LANGUAGES CXX
)
Expand Down
4 changes: 2 additions & 2 deletions src/Monitoring.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ void Monitoring::flushBuffer()
for (auto& backend : mBackends) {
if (matchVerbosity(backend->getVerbosity(), static_cast<Verbosity>(verbosity))) {
backend->send(std::move(buffer));

This comment has been minimized.

Copy link
@ironMann

ironMann May 28, 2021

This probably solves what I saw. Also, this should not be move, semantically, but rather const ref/copy.

buffer.clear();
}
}
buffer.clear();
}
}

Expand All @@ -74,9 +74,9 @@ void Monitoring::flushBuffer(const short index)
for (auto& backend : mBackends) {
if (matchVerbosity(backend->getVerbosity(), static_cast<Verbosity>(index))) {
backend->send(std::move(mStorage[index]));
mStorage[index].clear();
}
}
mStorage[index].clear();
}

void Monitoring::enableProcessMonitoring(const unsigned int interval)
Expand Down

0 comments on commit 694e128

Please sign in to comment.