# Disconnect signal that connected from script

I connected signal when a scene is instantiated.

# AsteroidSpawner.gd
func spawn_asteroid():
var asteroid_instance = asteroid_scene.instance()
asteroid_instance.connect("destroy", self, "handle_asteroid_destroy")
func handle_asteroid_destroy():
... # TO SOME STUFFS WHEN ASTEROID DESTROYED...
... # How to disconnect this handler from here?


But the problem is, I want to disconnect handle_asteroid_destroy handler when object destroyed(or will destroy, use queue_free). How do I disconnect signal on specific object? Is Godot Engine will free the handler automatically?

You can also use CONNECT_ONESHOT to ensure that a signal is disconnected after firing once, though it is not necessary in this situation.