# free allocated memory upon call \`join\` · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/622b7c47468bc4508f4cfe840e0f8c51b54949dd)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 622b7c47468bc4508f4cfe840e0f8c51b54949dd

Requested commit: 622b7c47468bc4508f4cfe840e0f8c51b54949dd

Commit: 622b7c47468bc4508f4cfe840e0f8c51b54949dd

Tree: 987bad278d24c50313ec104e60a0fc6b00d20d50

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
free allocated memory upon call `join`

When `join` detects a thread has completed, it will free the allocated
memory of the thread. For this we must first copy the allocator. This is
required as the allocated memory holds a reference to the original
allocator. If we free the memory, we would end up with UB as the
allocator would free itself.

```

## Parents

- [834609038c83e0122b506fadfa38b9acb7ee9068](https://git.cafe/gitcafe/zig/commit/834609038c83e0122b506fadfa38b9acb7ee9068?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/622b7c47468bc4508f4cfe840e0f8c51b54949dd?format=markdown)
