openddl-parser icon indicating copy to clipboard operation
openddl-parser copied to clipboard

Global s_allocatedNodes accessed without synchronization

Open turol opened this issue 2 years ago • 1 comments

Global s_allocatedNodes is defined here: https://github.com/kimkulling/openddl-parser/blob/3fbbe5eda59a9b13d2285a111070d6db7ed57a8b/code/DDLNode.cpp#L31 and accessed in multiple places without synchronization. This can break badly when the library is used in multithreaded program, for example with several instances of assimp Importer.

A workaround would be adding synchronization to all accesses. An actual solution would be removing this and making it local to each instance somehow.

turol avatar Feb 23 '23 12:02 turol

Good point!

kimkulling avatar Feb 27 '23 15:02 kimkulling