Skip to content

KD_TREE::delete_tree_nodes() does not destroy push_down_mutex_lock #9

@salovision

Description

@salovision

I had an issue where KD_TREE::InitTreeNode() didn't get valid mutex from pthread_mutex_init() because it ran out of handles (it returned nullptr and crashed later when accessing nullptr mutex pointer). Then I noticed that push_down_mutex_lock is never destroyed when KD_TREE_NODE is deleted.

I added pthread_mutex_destroy( &(*root)->push_down_mutex_lock ); to KD_TREE::delete_tree_nodes() and the problem went away. So currently it leaks mutex handles which you may ran out of if you create/delete lot of nodes.

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