Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
skhaz committed Dec 17, 2024
1 parent b44cb45 commit 5a0a543
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/fontfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ std::shared_ptr<font> fontfactory::get(const std::string &family) {
}

void fontfactory::flush() noexcept {
std::erase_if(_pool, [](const auto &pair) { return pair.second.use_count() == MINIMAL_USE_COUNT; });
std::cout << "[fontfactory] actual size " << _pool.size() << std::endl;

const auto count = std::erase_if(_pool, [](const auto &pair) { return pair.second.use_count() == MINIMAL_USE_COUNT; });
std::cout << "[fontfactory] " << count << " objects have been flushed" << std::endl;
}

void fontfactory::update(float_t delta) noexcept {
Expand Down
5 changes: 4 additions & 1 deletion src/soundmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ void soundmanager::stop(const std::string &filename) noexcept {
}

void soundmanager::flush() noexcept {
std::erase_if(_pool, [](const auto &pair) { return pair.second.use_count() == MINIMAL_USE_COUNT; });
std::cout << "[soundmanager] actual size " << _pool.size() << std::endl;

const auto count = std::erase_if(_pool, [](const auto &pair) { return pair.second.use_count() == MINIMAL_USE_COUNT; });
std::cout << "[soundmanager] " << count << " objects have been flushed" << std::endl;
}

void soundmanager::update(float_t delta) noexcept {
Expand Down

0 comments on commit 5a0a543

Please sign in to comment.