Fix crash in Release configuration
This commit is contained in:
@@ -154,9 +154,19 @@ static void add_owner(object_ptr<Ty>& ptr)
|
||||
if (ptr_) counter::remove_object<Ty>(ptr_);
|
||||
}
|
||||
|
||||
Ty* get() const noexcept { return ptr_.load(); }
|
||||
Ty& operator*() const noexcept { return *ptr_; }
|
||||
Ty* operator->() const noexcept { return ptr_.load(); }
|
||||
Ty* get() const { return ptr_.load(); }
|
||||
Ty& operator*() const
|
||||
{
|
||||
if (!ptr_.load())
|
||||
throw std::runtime_error("Null pointer");
|
||||
return *ptr_;
|
||||
}
|
||||
Ty* operator->() const
|
||||
{
|
||||
if (!ptr_.load())
|
||||
throw std::runtime_error("Null pointer");
|
||||
return ptr_.load();
|
||||
}
|
||||
operator bool() const noexcept { return ptr_.load() != nullptr; }
|
||||
object_ptr<Ty>& operator=(const object_ptr<Ty>& ptr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user