api-issue-tracker
api-issue-tracker copied to clipboard
SketchUp crashes on quit when using Sketchup.send_action in html dialog on_close event
Tested on SketchUp 2024 on Windows.
SketchUp crashes when the user quits if a HtmlDialog is open that has a on_closed event handler that calls Sketchup.send_action
Paste the following code snippet into the ruby console and then quit SketchUp to reproduce:
module TestingDialog
def self.show
@dialog = UI::HtmlDialog.new(
dialog_title: 'SketchUp Crasher',
style: UI::HtmlDialog::STYLE_DIALOG
)
@dialog.set_on_closed do
Sketchup.send_action('selectSelectionTool:')
end
@dialog.show
end
end
TestingDialog.show
Did you test on any earlier versions?
Did you test on any earlier versions?
No, not yet. I only have SketchUp 2024 installed at the moment.
I discovered that a solution is to use Sketchup.active_model.select_tool(nil) instead of send_action - that does not cause SketchUp to crash.
Logged as: SKEXT-4141
Did you test on any earlier versions?
No, not yet. I only have SketchUp 2024 installed at the moment.
I discovered that a solution is to use
Sketchup.active_model.select_tool(nil)instead ofsend_action- that does not cause SketchUp to crash.
Thanks for the follow up.
I'd strongly recommend avoiding send_action whenever possible. It's not a stable API and it'll likely be deprecated.