summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-05-22 17:02:23 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-05-22 17:02:23 +0200
commit5dc093b19a26b5055ceecaf1e1076bb5b4529a5a (patch)
tree5a277d7a98402ece618c9d6efac1dcc7bbe55e45 /core
parentab935aaac63bdfcbd34eb06f6f94111b84d27e84 (diff)
parent69f2bc27517a0a352f0a7859de16c2fafa7a0264 (diff)
downloadredot-engine-5dc093b19a26b5055ceecaf1e1076bb5b4529a5a.tar.gz
Merge pull request #77341 from RedworkDE/doctool-material-error-fix
Fix error in `BaseMaterial3D` when running doctool
Diffstat (limited to 'core')
-rw-r--r--core/templates/self_list.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/templates/self_list.h b/core/templates/self_list.h
index c3d7391d6c..ff6fa953ae 100644
--- a/core/templates/self_list.h
+++ b/core/templates/self_list.h
@@ -99,11 +99,20 @@ public:
p_elem->_root = nullptr;
}
+ void clear() {
+ while (_first) {
+ remove(_first);
+ }
+ }
+
_FORCE_INLINE_ SelfList<T> *first() { return _first; }
_FORCE_INLINE_ const SelfList<T> *first() const { return _first; }
_FORCE_INLINE_ List() {}
- _FORCE_INLINE_ ~List() { ERR_FAIL_COND(_first != nullptr); }
+ _FORCE_INLINE_ ~List() {
+ // A self list must be empty on destruction.
+ DEV_ASSERT(_first == nullptr);
+ }
};
private: