forked from upstream-mirrors/quik
fix memleak and manual release regex
This commit is contained in:
@@ -75,7 +75,7 @@ jobs:
|
|||||||
new_name = f"{major}.{minor}.{patch}"
|
new_name = f"{major}.{minor}.{patch}"
|
||||||
new_code = current_code + 1
|
new_code = current_code + 1
|
||||||
|
|
||||||
content, code_count = code_pattern.subn(rf"\1{new_code}", content, count=1)
|
content, code_count = code_pattern.subn(lambda m: f"{m.group(1)}{new_code}", content, count=1)
|
||||||
content, name_count = name_pattern.subn(lambda m: f"{m.group(1)}{new_name}{m.group(3)}", content, count=1)
|
content, name_count = name_pattern.subn(lambda m: f"{m.group(1)}{new_name}{m.group(3)}", content, count=1)
|
||||||
|
|
||||||
if code_count != 1 or name_count != 1:
|
if code_count != 1 or name_count != 1:
|
||||||
|
|||||||
@@ -313,8 +313,8 @@ class ConversationRepositoryImpl @Inject constructor(
|
|||||||
override fun getConversation(recipient: String) =
|
override fun getConversation(recipient: String) =
|
||||||
getConversation(listOf(recipient))
|
getConversation(listOf(recipient))
|
||||||
|
|
||||||
override fun getConversation(recipients: Collection<String>) =
|
override fun getConversation(recipients: Collection<String>): Conversation? =
|
||||||
Realm.getDefaultInstance().let { realm ->
|
Realm.getDefaultInstance().use { realm ->
|
||||||
realm.refresh()
|
realm.refresh()
|
||||||
realm.where(Conversation::class.java)
|
realm.where(Conversation::class.java)
|
||||||
.findAll()
|
.findAll()
|
||||||
@@ -325,6 +325,7 @@ class ConversationRepositoryImpl @Inject constructor(
|
|||||||
recipients.any { recipient -> phoneNumberUtils.compare(recipient, address) }
|
recipients.any { recipient -> phoneNumberUtils.compare(recipient, address) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
?.let { realm.copyFromRealm(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getOrCreateConversation(threadId: Long) =
|
override fun getOrCreateConversation(threadId: Long) =
|
||||||
|
|||||||
Reference in New Issue
Block a user