Merge pull request #33147 from mikkac/33135

Fixed disconnecting not connected signal
This commit is contained in:
Rémi Verschelde 2019-10-29 12:01:01 +01:00 committed by GitHub
commit 0641acc576
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 6 deletions

View File

@ -95,7 +95,9 @@ void EditorDirDialog::_notification(int p_what) {
}
if (p_what == NOTIFICATION_EXIT_TREE) {
EditorFileSystem::get_singleton()->disconnect("filesystem_changed", this, "reload");
if (EditorFileSystem::get_singleton()->is_connected("filesystem_changed", this, "reload")) {
EditorFileSystem::get_singleton()->disconnect("filesystem_changed", this, "reload");
}
}
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {

View File

@ -397,8 +397,9 @@ void VersionControlEditorPlugin::clear_stage_area() {
void VersionControlEditorPlugin::shut_down() {
if (EditorVCSInterface::get_singleton()) {
EditorFileSystem::get_singleton()->disconnect("filesystem_changed", this, "_refresh_stage_area");
if (EditorFileSystem::get_singleton()->is_connected("filesystem_changed", this, "_refresh_stage_area")) {
EditorFileSystem::get_singleton()->disconnect("filesystem_changed", this, "_refresh_stage_area");
}
EditorVCSInterface::get_singleton()->shut_down();
memdelete(EditorVCSInterface::get_singleton());
EditorVCSInterface::set_singleton(NULL);

View File

@ -1037,7 +1037,9 @@ void CPUParticles2D::_set_redraw(bool p_redraw) {
VS::get_singleton()->multimesh_set_visible_instances(multimesh, -1);
} else {
VS::get_singleton()->disconnect("frame_pre_draw", this, "_update_render_thread");
if (VS::get_singleton()->is_connected("frame_pre_draw", this, "_update_render_thread")) {
VS::get_singleton()->disconnect("frame_pre_draw", this, "_update_render_thread");
}
VS::get_singleton()->canvas_item_set_update_when_visible(get_canvas_item(), false);
VS::get_singleton()->multimesh_set_visible_instances(multimesh, 0);

View File

@ -1124,7 +1124,9 @@ void CPUParticles::_set_redraw(bool p_redraw) {
VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, true);
VS::get_singleton()->multimesh_set_visible_instances(multimesh, -1);
} else {
VS::get_singleton()->disconnect("frame_pre_draw", this, "_update_render_thread");
if (VS::get_singleton()->is_connected("frame_pre_draw", this, "_update_render_thread")) {
VS::get_singleton()->disconnect("frame_pre_draw", this, "_update_render_thread");
}
VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, false);
VS::get_singleton()->multimesh_set_visible_instances(multimesh, 0);
}

View File

@ -460,7 +460,9 @@ void SoftBody::update_physics_server() {
} else {
PhysicsServer::get_singleton()->soft_body_set_mesh(physics_rid, NULL);
VS::get_singleton()->disconnect("frame_pre_draw", this, "_draw_soft_mesh");
if (VS::get_singleton()->is_connected("frame_pre_draw", this, "_draw_soft_mesh")) {
VS::get_singleton()->disconnect("frame_pre_draw", this, "_draw_soft_mesh");
}
}
}