Skip to content

Commit

Permalink
Ensure HashMap destruction works in safe code. Fixes #15.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig committed Jan 4, 2025
1 parent 1992717 commit 1e99af7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/vibe/container/hashmap.d
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ struct HashMap(TKey, TValue, Traits = DefaultHashMapTraits!TKey, Allocator = IAl
}
}

nothrow unittest {
@safe nothrow unittest {
import std.conv;

HashMap!(string, string) map;
Expand Down
2 changes: 1 addition & 1 deletion source/vibe/container/internal/rctable.d
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct RCTable(T, Allocator = IAllocator) {
}

~this()
{
@trusted {
if (m_table.ptr && --this.refCount == 0) {
static if (hasIndirections!T) {
if (m_table.ptr !is null) () @trusted {
Expand Down

0 comments on commit 1e99af7

Please sign in to comment.