Skip to content

maybe leak: ConcurrentCollection use Lock but seems never close() it #117

@Rowandjj

Description

@Rowandjj

ConcurrentMutableCollection use Lock but never close() it.

actual class Lock actual constructor() {
    private val arena = Arena()
    private val attr = arena.alloc<pthread_mutexattr_t>()
    private val mutex = arena.alloc<pthread_mutex_t>()
    
    ....
    fun internalClose() {
        pthread_mutex_destroy(mutex.ptr)
        pthread_mutexattr_destroy(attr.ptr)
        arena.clear()
    }
}

actual inline fun Lock.close() {
    internalClose()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions