Skip to content

Commit

Permalink
dont cocos outside of main thread
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Jul 7, 2024
1 parent aa05fe5 commit 2c92f4f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changelog
## <cg>v4.2.1</c> (2024-07-08)
## <cg>v4.2.1 / v4.2.2</c> (2024-07-08)
* <cg>Adjusted</c> internal rate-limits for BetterInfo caching
* Other bugfixes & improvements

Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"geode": "3.2.0",
"version": "v4.2.1",
"version": "v4.2.2",
"gd": {
"win": "2.206",
"android": "2.206",
Expand Down
11 changes: 8 additions & 3 deletions src/managers/BetterInfoCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,15 @@ size_t BetterInfoCache::claimableListsCount() {
void BetterInfoCache::downloadClaimableLists() {
if(m_claimableLists.empty()) return;

std::thread([this] {
for(auto [listID, _] : m_claimableLists) {
if(_ != nullptr) continue;
std::vector<int> toDownload;
for(auto [listID, _] : m_claimableLists) {
if(_ != nullptr) continue;

toDownload.push_back(listID);
}

std::thread([this, toDownload = std::move(toDownload)] {
for(auto listID : toDownload) {
auto searchObj = GJSearchObject::create(SearchType::Search, std::to_string(listID));
ServerUtils::getLevelLists(
searchObj,
Expand Down

0 comments on commit 2c92f4f

Please sign in to comment.