== and != operators for Ref<T> / T*

This is to prevent crashes for code like:

...
void Material::set_next_pass(const Ref<Material> &p_pass) {

	ERR_FAIL_COND(p_pass == this);
...

that's been fixed in 031f763d4f
This commit is contained in:
Marcin Zawiejski
2018-08-21 00:47:26 +02:00
parent 238b70e2db
commit a1d2fbdeb2
2 changed files with 8 additions and 1 deletions

View File

@@ -34,7 +34,7 @@
void Material::set_next_pass(const Ref<Material> &p_pass) {
ERR_FAIL_COND(p_pass.ptr() == this);
ERR_FAIL_COND(p_pass == this);
if (next_pass == p_pass)
return;