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

Printing to ruby console or issuing UI.messagebox in AppObserver.onNewModel produces bugsplat #1006

Open
agilmartin opened this issue Oct 11, 2024 · 1 comment

Comments

@agilmartin
Copy link

The issue occurs when observer AppObserver is attached to the Sketchup and the method onNewModel prints to console or issue an UI.messagebox. After drawing to the model and then selecting File-> New from the menu, the Sketchup produces a bugsplat. The bugsplating doesn't happen every time, but after repeating the steps several times it happens sooner or later. The issue only happens in Sketchup 2024 and not in 2023 and earlier versions.

  1. SketchUp/LayOut Version: 24.0.594 x64
  2. OS Platform: Windows

Steps to reproduce.

  1. Attach an AppObserver obesrver to Sketchup:
class MyAppObserver < Sketchup::AppObserver
  def onNewModel(model)
    puts "onNewModel called"
  end
end
Sketchup.add_observer(MyAppObserver.new)

or

class MyAppObserver < Sketchup::AppObserver
  def onNewModel(model)
    UI.messagebox("onNewModel called", MB_OK)
  end
end
Sketchup.add_observer(MyAppObserver.new)
  1. Open ruby console
  2. Open default tray
  3. Open Tags section in Default tray
  4. Draw something in the model (a rectangle, circle, etc.)
  5. Select File->New from the menu
  6. Repeat 5. and 6.

Sooner or later, the Sketchup will bugsplat.

Workaround

Wrapping the code in onNewModel in seems to prevent bugsplats:

class MyAppObserver < Sketchup::AppObserver
  def onNewModel(model)
    UI.start_timer(0, false) { UI.messagebox("onNewModel called", MB_OK) }
  end
end
@sketchup
Copy link

sketchup bot commented Oct 28, 2024

Logged as: SKEXT-4338

@sketchup sketchup bot added the logged label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants