Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
Merge pull request #40 from forno/hotfix-memory-error
Browse files Browse the repository at this point in the history
Upgrade v1.3.2
  • Loading branch information
forno committed Jan 3, 2017
2 parents 7bba3bc + 5498d3d commit 5b9ec8e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(ics3 C CXX)

set(PROJECT_VER_MAJOR 1)
set(PROJECT_VER_MINOR 3)
set(PROJECT_VER_PATCH 1)
set(PROJECT_VER_PATCH 2)
set(PROJECT_VER "${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}.${PROJECT_VER_PATCH}")
set(PROJECT_APIVER "${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}")

Expand Down
2 changes: 1 addition & 1 deletion src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ std::shared_ptr<ics::Core> ics::Core::getCore(const std::string& path, speed_t b
{
static std::unordered_map<std::string, std::weak_ptr<Core>> cache;
auto objPtr = cache[path].lock(); // try get
for (const auto& data : cache) if (data.second.expired()) cache.erase(data.first); // clean cashe
// for (const auto& data : cache) if (data.second.expired()) cache.erase(data.first); // clean cashe //FIXME error code
if (!objPtr) { // get failed
objPtr = std::make_shared<Core>(path, baudrate);
cache[path] = objPtr;
Expand Down

0 comments on commit 5b9ec8e

Please sign in to comment.