[Issue/Bug]: Hanging on get_tree().quit() in editor #59

Closed
opened 2024-07-29 20:02:31 +00:00 by obfuscatedgenerated · 6 comments
obfuscatedgenerated commented 2024-07-29 20:02:31 +00:00 (Migrated from github.com)

What happened?

When I click a button to call get_tree().quit(), the game hangs and doesn't close. I believe a thread is hanging or something of the sort. This only seems to happen when running the game in the editor and doesn't occur on release (so perhaps there is an issue in the debug dlls but not the release ones?). I have verified that it is an issue with the discord plugin by disabling both the plugin and my Discord singleton and the issue doesn't occur.

Version

1.3.0

Godot Version

4.2.2-stable (Windows 10)

Exact steps to reproduce this error

  1. Enable discord rpc plugin
  2. Have my game write rich presence
  3. Press a button to quit using get_tree().quit()
  4. Game hangs, with no errors in the log

GDScript

extends Node

func _ready():
	DiscordRPC.app_id = xxxxxxxxxxx
	
	DiscordRPC.details = "Starting up..."
	DiscordRPC.state = ""
		
	DiscordRPC.large_image = "default"
	DiscordRPC.large_image_text = ""

	DiscordRPC.start_timestamp = int(Time.get_unix_time_from_system())
		
	DiscordRPC.refresh()

Godot output

N/A

Additional information

No response

Checks

### What happened? When I click a button to call `get_tree().quit()`, the game hangs and doesn't close. I believe a thread is hanging or something of the sort. This only seems to happen when running the game in the editor and doesn't occur on release (so perhaps there is an issue in the debug dlls but not the release ones?). I have verified that it is an issue with the discord plugin by disabling both the plugin and my Discord singleton and the issue doesn't occur. ### Version 1.3.0 ### Godot Version 4.2.2-stable (Windows 10) ### Exact steps to reproduce this error 1. Enable discord rpc plugin 2. Have my game write rich presence 3. Press a button to quit using `get_tree().quit()` 4. Game hangs, with no errors in the log ### GDScript ```gdscript extends Node func _ready(): DiscordRPC.app_id = xxxxxxxxxxx DiscordRPC.details = "Starting up..." DiscordRPC.state = "" DiscordRPC.large_image = "default" DiscordRPC.large_image_text = "" DiscordRPC.start_timestamp = int(Time.get_unix_time_from_system()) DiscordRPC.refresh() ``` ### Godot output ```shell N/A ``` ### Additional information _No response_ ### Checks - [X] I tried reinstalling the addon or tried to fix it myself with other methods. - [X] I tried restarting Discord and Godot completely. - [X] I did read the documentation https://vaporvee.com/docs/discord-rpc-godot/
obfuscatedgenerated commented 2024-07-29 20:04:29 +00:00 (Migrated from github.com)

Disabled and reenabled plugin yet again and it now no longer hangs (???) but the fact that the behaviour seems to be related to the plugin means this issue should still be open. Sorry I don't have any extra info to provide

Disabled and reenabled plugin yet again and it now no longer hangs (???) but the fact that the behaviour seems to be related to the plugin means this issue should still be open. Sorry I don't have any extra info to provide

On which platform? And do you use EditorPresence? Sorry need to add these to the form

On which platform? And do you use EditorPresence? Sorry need to add these to the form

And this hanging was a bug from previous versions so thats even weirder that it radomly appears. Maybe some weird caching? Will take another look but unfortunately this plugin is on a low prio because i need to dev for paid projects currently

And this hanging was a bug from previous versions so thats even weirder that it radomly appears. Maybe some weird caching? Will take another look but unfortunately this plugin is on a low prio because i need to dev for paid projects currently
obfuscatedgenerated commented 2024-07-30 14:56:00 +00:00 (Migrated from github.com)

Hey, I'm on Windows 10 and I'm not using editor presence. No problems about this being low priority, easily remedied and I understand the grind haha

Hey, I'm on Windows 10 and I'm not using editor presence. No problems about this being low priority, easily remedied and I understand the grind haha
obfuscatedgenerated commented 2024-08-03 21:33:00 +00:00 (Migrated from github.com)

Seems to be resolved by just sending the quit notification before quitting as noted on the docs for a graceful shutdown:

get_tree().root.propagate_notification(NOTIFICATION_WM_CLOSE_REQUEST)
get_tree().quit()
Seems to be resolved by just sending the quit notification before quitting as noted on the docs for a graceful shutdown: ```gdscript get_tree().root.propagate_notification(NOTIFICATION_WM_CLOSE_REQUEST) get_tree().quit() ```

Oh that sounds good will document that because other people had this issue still after i fixed it with my plugin

Oh that sounds good will document that because other people had this issue still after i fixed it with my plugin
Sign in to join this conversation.
No description provided.