Repository: godotengine/godot (language: cpp)

Issue:
`Tween.kill()` does not make `is_valid()` return `false` unless waiting for another tick
### Tested versions

- Reproducible in v4.4.beta4.official [93d270693]

### System information

Godot v4.4.beta4 - Windows 11 (build 22631) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Ti (NVIDIA; 32.0.15.6636) - 13th Gen Intel(R) Core(TM) i5-13600KF (20 threads)

### Issue description

```
extends Node2D

func _ready() -> void:
	var tween = create_tween()
	tween.tween_interval(5)
	
	await get_tree().create_timer(1).timeout
	tween.kill()
	printt("is valid:", tween.is_valid())
	
	await get_tree().process_frame
	printt("--------after a tick...------")
	printt("is valid:", tween.is_valid())
	
```
output:
```
is valid:	true
--------after a tick...------
is valid:	false
```

The kill() can not make a tween invalid immediately. Or should the document be updated and informed of this?


### Steps to reproduce

use script above.

### Minimal reproduction project (MRP)

use script above.


Discussion / hints:
Can confirm, also happens in `4.3.stable`

Fix patch:
diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp
index 4fe3b70da4e7..61114ccc21aa 100644
--- a/scene/animation/tween.cpp
+++ b/scene/animation/tween.cpp
@@ -212,6 +212,7 @@ void Tween::play() {
 
 void Tween::kill() {
 	running = false; // For the sake of is_running().
+	valid = false;
 	dead = true;
 }
 


Test patch: