Skip to content

Commit f31e06d

Browse files
committed
Woops3
1 parent af1e9e6 commit f31e06d

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

MarathonRecomp/api/Sonicteam/SoX/RefSharedPointer.h

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
namespace Sonicteam::SoX
77
{
8-
98
template <typename RefType = RefCountObject>
109
class RefSharedPointer
1110
{
@@ -56,14 +55,13 @@ namespace Sonicteam::SoX
5655

5756
RefSharedPointer& operator=(const RefSharedPointer& other)
5857
{
59-
if (this != &other) {
60-
if (m_value.get()) {
61-
m_value->Release();
62-
}
63-
58+
if (this != &other)
59+
{
60+
reset();
6461
m_value = other.m_value;
6562

66-
if (m_value.get()) {
63+
if (m_value.get())
64+
{
6765
m_value->AddRef();
6866
}
6967
}
@@ -72,10 +70,9 @@ namespace Sonicteam::SoX
7270

7371
RefSharedPointer& operator=(RefSharedPointer&& other) noexcept
7472
{
75-
if (this != &other) {
76-
if (m_value.get()) {
77-
m_value->Release();
78-
}
73+
if (this != &other)
74+
{
75+
reset();
7976

8077
m_value = std::move(other.m_value);
8178
other.m_value = nullptr;

0 commit comments

Comments
 (0)