| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2bcf535 commit 6f06cf0
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -234,13 +234,13 @@ BaseObject* BaseObjectPtrImpl<T, kIsWeak>::get_base_object() const { | |||
| 234 | 234 | ||
| 235 | 235 | template <typename T, bool kIsWeak> | |
| 236 | 236 | BaseObjectPtrImpl<T, kIsWeak>::~BaseObjectPtrImpl() { | |
| 237 | - if (get() == nullptr) return; | ||
| 238 | 237 | if (kIsWeak) { | |
| 239 | - if (--pointer_data()->weak_ptr_count == 0 && | ||
| 238 | + if (pointer_data() != nullptr && | ||
| 239 | + --pointer_data()->weak_ptr_count == 0 && | ||
| 240 | 240 | pointer_data()->self == nullptr) { | |
| 241 | 241 | delete pointer_data(); | |
| 242 | 242 | } | |
| 243 | - } else { | ||
| 243 | + } else if (get() != nullptr) { | ||
| 244 | 244 | get()->decrease_refcount(); | |
| 245 | 245 | } | |
| 246 | 246 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments