Fixed data access after free.
Merge pull request #3 from NLeSC/multithreaded-udt

Fixed data access after free.