Skip to content

Commit

Permalink
Merge pull request #39 from qiaoyuang/main
Browse files Browse the repository at this point in the history
Fix withOpen
  • Loading branch information
qiaoyuang authored Jul 21, 2024
2 parents 54edca6 + caec692 commit 1ed9cb8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

- Date format: YYYY-MM-dd

## v1.2.14/ 2024-xx-xx

Fixed the function `MMKV_KMP.withOpen`

## v1.2.13 / 2024-07-16

* Based on `Kotlin 1.9.24`, `MMKV 1.3.7`
Expand Down
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
alias(libs.plugins.multiplatform).apply(false)
alias(libs.plugins.cocoapods).apply(false)
alias(libs.plugins.android.library).apply(false)
alias(libs.plugins.multiplatform) apply false
alias(libs.plugins.cocoapods) apply false
alias(libs.plugins.android.library) apply false
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ package com.ctrip.flight.mmkv
* @author yaqiao
*/

inline fun <T> MMKV_KMP.withOpen(block: MMKV_KMP.() -> T): T {
val result = block()
inline fun <T> MMKV_KMP.withOpen(block: MMKV_KMP.() -> T): T = try {
block()
} finally {
close()
return result
}

0 comments on commit 1ed9cb8

Please sign in to comment.