Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash "Control was not in dock." (edgecase) #78878

Closed
clemens-tolboom opened this issue Jun 30, 2023 · 1 comment · Fixed by #83512
Closed

Crash "Control was not in dock." (edgecase) #78878

clemens-tolboom opened this issue Jun 30, 2023 · 1 comment · Fixed by #83512

Comments

@clemens-tolboom
Copy link

Godot version

v4.1.rc2.official [4642448]

System information

Godot v4.1.rc2 - macOS 13.4.1 - Vulkan (Compatibility) - Apple M1 - Apple M1 (8 Threads)

Issue description

Reloading GD OpenAI coding.
ERROR: Control was not in dock.
   at: remove_control_from_dock (editor/editor_node.cpp:5835)
(empty)

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.1.rc2.official (46424488edc341b65467ee7fd3ac423e4d49ad34)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] 1   libsystem_platform.dylib            0x0000000181aaaa24 _sigtramp + 56
[2] AspectRatioContainer::get_alignment_vertical() const
[3] ShaderGlobalsEditorInterface::_get_property_list(List<PropertyInfo, DefaultAllocator>*) const
[4] JSON::get_data() const
[5] Object::get_instance_id() const
[6] Ref<DirAccess> DirAccess::_create_builtin<DirAccessMacOS>()
[7] RendererCompositorRD::_create_current()
[8] 8   AppKit                              0x0000000185044f2c __19-[NSWindow __close]_block_invoke + 136
[9] 9   AppKit                              0x0000000185044e90 -[NSWindow __close] + 272
[10] 10  AppKit                              0x0000000184f218a8 -[NSApplication(NSResponder) sendAction:to:from:] + 440
[11] 11  AppKit                              0x0000000184f216c0 -[NSControl sendAction:to:] + 72
[12] 12  AppKit                              0x0000000184f21604 __26-[NSCell _sendActionFrom:]_block_invoke + 100
[13] 13  AppKit                              0x0000000184f2152c -[NSCell _sendActionFrom:] + 204
[14] 14  AppKit                              0x0000000184f21450 -[NSButtonCell _sendActionFrom:] + 88
[15] 15  AppKit                              0x0000000184f1ea54 NSControlTrackMouse + 1480
[16] 16  AppKit                              0x0000000184f1e460 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 144
[17] 17  AppKit                              0x0000000184f1e318 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 488
[18] 18  AppKit                              0x0000000184f1d7e4 -[NSControl mouseDown:] + 448
[19] 19  AppKit                              0x0000000184f1c2cc -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 3476
[20] 20  AppKit                              0x0000000184ea6f08 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 364
[21] 21  AppKit                              0x0000000184ea6bc8 -[NSWindow(NSEventRouting) sendEvent:] + 284
[22] 22  AppKit                              0x0000000184ea5f0c -[NSApplication(NSEvent) sendEvent:] + 1556
[23] Ref<DirAccess> DirAccess::_create_builtin<DirAccessMacOS>()
[24] Ref<DirAccess> DirAccess::_create_builtin<DirAccessMacOS>()
[25] 25  Godot                               0x00000001051482c8 Godot + 4031176
[26] RendererCompositorRD::_create_current()
[27] 27  dyld                                0x0000000181723f28 start + 2236
-- END OF BACKTRACE --
================================================================
[1]    12342 abort      /Applications/Godot_v4.1-rc2_macos.universal.app/Contents/MacOS/Godot 

Steps to reproduce

Allow editor plugin to reload itself and make it float. Then reload then close the floating empty

Plugin with reload button

image

Reloaded plugin with empty float

image

Script used

func _enter_tree():
	dock = preload("res://addons/gd-openai-coding/dock.tscn").instantiate()
	add_control_to_dock(DOCK_SLOT_RIGHT_BL, dock)

	dock.find_child("Reload").connect("pressed", self.reload)

func _exit_tree():
	remove_control_from_docks(dock)
	dock.queue_free()

func reload():
	print("Reloading GD OpenAI coding.")
	_exit_tree()
	_enter_tree()

Minimal reproduction project

test-gd-openai.zip

@AThousandShips
Copy link
Member

It should probably also search the floating docks, will take a look at a possible fix for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants