Skip to content

Commit

Permalink
Harden put functions against misuse (#986)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr authored Jul 21, 2021
1 parent c978627 commit 00bc3b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion strings/base_com_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ WINRT_EXPORT namespace winrt

type** put() noexcept
{
WINRT_ASSERT(m_ptr == nullptr);
release_ref();
return &m_ptr;
}

Expand Down
2 changes: 1 addition & 1 deletion strings/base_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ WINRT_EXPORT namespace winrt

type* put() noexcept
{
WINRT_ASSERT(m_value == T::invalid());
close();
return &m_value;
}

Expand Down

0 comments on commit 00bc3b8

Please sign in to comment.