migueldeicaza / SwiftGodot

New Godot bindings for Swift
https://migueldeicaza.github.io/SwiftGodotDocs/tutorials/swiftgodot-tutorials/
MIT License
1.06k stars 64 forks source link

On Windows, Godot does not exit correctly #438

Open Airyzz opened 5 months ago

Airyzz commented 5 months ago

Both in the godot editor, as well as exported projects, the process does not exit correctly when closed. After closing, it gets stuck in an infinite loop while trying to unload swift library:

This happens in Simple demo extension, so I don't believe it's user error

The game window will close, but task manager shows that the process is still running

image

Airyzz commented 5 months ago

As a work around, could do something like this:

extends Node

func _ready():
    get_tree().auto_accept_quit = false

func _notification(what):
    if what == NOTIFICATION_WM_CLOSE_REQUEST:
        var current_process = OS.get_process_id()
        OS.kill(current_process)