mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-10 04:00:08 +08:00
Hold strong reference in RemoteFileImpl.contact
This commit is contained in:
parent
814718403e
commit
2ae12f4d37
@ -100,11 +100,9 @@ internal fun RemoteFile.checkIsImpl(): RemoteFileImpl {
|
||||
}
|
||||
|
||||
internal class RemoteFileImpl(
|
||||
contact: Group,
|
||||
override val contact: Group,
|
||||
override val path: String, // absolute
|
||||
) : RemoteFile {
|
||||
private val contactRef by contact.weakRef()
|
||||
override val contact get() = contactRef ?: error("RemoteFile is closed due to Contact closed.")
|
||||
|
||||
constructor(contact: Group, parent: String, name: String) : this(contact, fs.normalize(parent, name))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user