mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-27 12:29:41 +00:00
Fix destructor of SharedArray in C++
We should of course only free the memory if the refcount reaches 0
This commit is contained in:
parent
0751552068
commit
4c07fbfb3d
1 changed files with 4 additions and 4 deletions
|
@ -64,11 +64,11 @@ private:
|
|||
for (auto it = b; it < e; ++it) {
|
||||
it->~T();
|
||||
}
|
||||
cbindgen_private::sixtyfps_shared_array_free(
|
||||
reinterpret_cast<uint8_t *>(inner),
|
||||
sizeof(SharedArrayHeader) + inner->capacity * sizeof(T),
|
||||
alignof(SharedArrayHeader));
|
||||
}
|
||||
cbindgen_private::sixtyfps_shared_array_free(
|
||||
reinterpret_cast<uint8_t *>(inner),
|
||||
sizeof(SharedArrayHeader) + inner->capacity * sizeof(T),
|
||||
alignof(SharedArrayHeader));
|
||||
}
|
||||
|
||||
// Unfortunately, this cannot be generated by cbindgen because std::atomic is not understood
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue