This commit is contained in:
altalk23 2023-04-10 14:35:27 +03:00
commit d0d0b79578
2 changed files with 7 additions and 5 deletions

View file

@ -60,7 +60,8 @@ static std::optional<int> queryMatchKeywords(
if (!someMatched) {
return std::nullopt;
}
} else {
}
else {
// this is like the dumbest way you could possibly sort alphabetically
// but it does enough to make the mods list somewhat alphabetically
// sorted, at least enough so that if you're scrolling it based on
@ -120,10 +121,7 @@ static std::optional<int> queryMatch(ModListQuery const& query, IndexItemHandle
static std::optional<int> queryMatch(ModListQuery const& query, InvalidGeodeFile const& info) {
// if any explicit filters were provided, no match
if (
query.tags.size() ||
query.keywords.has_value()
) {
if (query.tags.size() || query.keywords.has_value()) {
return std::nullopt;
}
return 0;

View file

@ -257,6 +257,10 @@ void WeakRefPool::check(CCObject* obj) {
// if this object's only reference is the WeakRefPool aka only weak
// references exist to it, then release it
if (obj && m_pool.contains(obj) && obj->retainCount() == 1) {
// set delegates to null because those aren't retained!
if (auto input = typeinfo_cast<CCTextInputNode*>(obj)) {
input->m_delegate = nullptr;
}
obj->release();
// log::info("nullify {}", m_pool.at(obj).get());
m_pool.at(obj)->m_obj = nullptr;