diff options
author | Mike Buland <eichlan@xagasoft.com> | 2021-08-18 22:11:41 -0700 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2021-08-18 22:11:41 -0700 |
commit | 345926296f748db5ff283ce69c0ed4d563fcc8ff (patch) | |
tree | 3aa50962107cb903bbf30bb2540c19d25bda5adf /src/stable/sharedcore.h | |
parent | 52833d24ba86c3e0fe90a12d65f6dc529e9280b7 (diff) | |
download | libbu++-345926296f748db5ff283ce69c0ed4d563fcc8ff.tar.gz libbu++-345926296f748db5ff283ce69c0ed4d563fcc8ff.tar.bz2 libbu++-345926296f748db5ff283ce69c0ed4d563fcc8ff.tar.xz libbu++-345926296f748db5ff283ce69c0ed4d563fcc8ff.zip |
Updating issues discovered using g++ 10
Diffstat (limited to 'src/stable/sharedcore.h')
-rw-r--r-- | src/stable/sharedcore.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/stable/sharedcore.h b/src/stable/sharedcore.h index 90765fc..4e1fcc8 100644 --- a/src/stable/sharedcore.h +++ b/src/stable/sharedcore.h | |||
@@ -89,9 +89,6 @@ namespace Bu | |||
89 | 89 | ||
90 | SharedCore &operator=( const SharedCore &rhs ) | 90 | SharedCore &operator=( const SharedCore &rhs ) |
91 | { | 91 | { |
92 | if( core == rhs.core ) | ||
93 | return *this; | ||
94 | |||
95 | _softCopy( rhs ); | 92 | _softCopy( rhs ); |
96 | return *this; | 93 | return *this; |
97 | } | 94 | } |
@@ -161,6 +158,18 @@ namespace Bu | |||
161 | delete pSrc; | 158 | delete pSrc; |
162 | } | 159 | } |
163 | 160 | ||
161 | void _softCopy( const _SharedType &rSrc ) | ||
162 | { | ||
163 | if( core == rSrc.core ) | ||
164 | return; | ||
165 | |||
166 | if( core ) | ||
167 | _deref(); | ||
168 | core = rSrc.core; | ||
169 | iRefCount = rSrc.iRefCount; | ||
170 | _incRefCount(); | ||
171 | } | ||
172 | |||
164 | private: | 173 | private: |
165 | void _deref() | 174 | void _deref() |
166 | { | 175 | { |
@@ -179,15 +188,6 @@ namespace Bu | |||
179 | ++(*iRefCount); | 188 | ++(*iRefCount); |
180 | } | 189 | } |
181 | 190 | ||
182 | void _softCopy( const _SharedType &rSrc ) | ||
183 | { | ||
184 | if( core ) | ||
185 | _deref(); | ||
186 | core = rSrc.core; | ||
187 | iRefCount = rSrc.iRefCount; | ||
188 | _incRefCount(); | ||
189 | } | ||
190 | |||
191 | int *iRefCount; | 191 | int *iRefCount; |
192 | }; | 192 | }; |
193 | }; | 193 | }; |