mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
12 lines
No EOL
259 B
Kotlin
12 lines
No EOL
259 B
Kotlin
package com.lagradost.cloudstream3.utils
|
|
|
|
interface IDisposable {
|
|
fun dispose()
|
|
}
|
|
|
|
object IDisposableHelper {
|
|
fun <T : IDisposable> using(disposeObject: T, work: (T) -> Unit) {
|
|
work.invoke(disposeObject)
|
|
disposeObject.dispose()
|
|
}
|
|
} |