fix crash when deleting shader from material, fixes #1631
This commit is contained in:
parent
7852be816a
commit
54ed432913
1 changed files with 1 additions and 1 deletions
|
@ -534,7 +534,7 @@ void ShaderMaterial::set_shader(const Ref<Shader>& p_shader) {
|
|||
if (shader.is_valid())
|
||||
shader->disconnect(SceneStringNames::get_singleton()->changed,this,SceneStringNames::get_singleton()->_shader_changed);
|
||||
shader=p_shader;
|
||||
VS::get_singleton()->material_set_shader(material,shader->get_rid());
|
||||
VS::get_singleton()->material_set_shader(material,shader.is_valid()?shader->get_rid():RID());
|
||||
if (shader.is_valid()) {
|
||||
shader->connect(SceneStringNames::get_singleton()->changed,this,SceneStringNames::get_singleton()->_shader_changed);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue