• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

Web Dialog bug?

Scheduled Pinned Locked Moved Developers' Forum
5 Posts 4 Posters 269 Views 4 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    Brett McAllister
    last edited by 11 May 2010, 01:36

    Hi there

    Currently I am creating some web dialogs and having some real issues with stability.
    For no reason at all the dialog will just shut and what ever I have been working on will be lost.
    Have any of you guys had this issue or is it just me?
    Any help would be appreciated. I am using Sketchup 7
    Cheers

    Brett

    1 Reply Last reply Reply Quote 0
    • T Offline
      tomasz
      last edited by 11 May 2010, 06:48

      One have to be careful especially when using a Tool and a Webdialog (and Observers).
      I think you crash SU because your tool closes a WebDialog already closed or something similar. It can also be caused by creating several instances of a same WebDialog without closing former.

      In a thread called Tool <> WebDialog <> Observers relationship I have started to build a 'proper' way of creating a Tool, WebDialog and an Observer. It is far from perfect. I am still learning how to make it error-proof.

      Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by 11 May 2010, 12:13

        Brett,

        It sounds like Ruby is garbage collecting the dialog - I've had this happen. If you are using a local variable to reference the dialog and the variable goes out of scope, it will be GC'd.

        
        # This dlg variable will get GC'd sooner or later and the
        # dialog may go away.
        def create_dialog
            dlg = WebDialog.new(...)
            dlg.show
        end
        
        

        One common solution is to use a module to create a namespace (a scope,) and use a class variable to reference the dialog.

        Hi

        1 Reply Last reply Reply Quote 0
        • B Offline
          Brett McAllister
          last edited by 11 May 2010, 19:07

          Thanks for the replies.
          The only ruby code I am using is just to load the dialog to test it so there is no namespacing etc.
          Sounds like that will solve the problem,so I will keep that in mind as I get further along.

          Cheers
          Brett

          1 Reply Last reply Reply Quote 0
          • M Offline
            MartinRinehart
            last edited by 12 May 2010, 18:16

            @brett mcallister said:

            Thanks for the replies.
            The only ruby code I am using is just to load the dialog to test it so there is no namespacing etc.
            Sounds like that will solve the problem,so I will keep that in mind as I get further along.

            Cheers
            Brett

            Failure to include two parameters in the code block of an action callback is a crime punishable by BugSplat.

            PC or Mac?

            Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            1 / 1
            • First post
              1/5
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement