HISE Logo Forum
    • Categories
    • Register
    • Login

    Are "var" variables inside a paint routine inside a namespace leaky?

    Scheduled Pinned Locked Moved Solved Scripting
    13 Posts 3 Posters 342 Views
    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.
    • d.healeyD
      d.healey @VirtualVirgin
      last edited by

      @VirtualVirgin said in Are "var" variables inside a paint routine inside a namespace leaky?:

      And given that the inline function works while breaking the paint routine in the other namespace would make it seem like the local "chordSymbol" variable is the one that is leaking...?

      Did you try changing chordSymbol to a different name temporarily to see if the error goes away?

      Libre Wave - Freedom respecting instruments and effects
      My Patreon - HISE tutorials
      YouTube Channel - Public HISE tutorials

      VirtualVirginV 1 Reply Last reply Reply Quote 1
      • ustkU
        ustk @VirtualVirgin
        last edited by ustk

        @VirtualVirgin Is the Paint Routine related the same panel that is in CSU?

        If yes, then since you do:

        panel.getValue().chordSymbol[row][col] = chordSymbol;
        

        Shouldn't the proper way to get it back be:

        var chordSymbol = this.getValue().chordSymbol[row][col];
        

        And as Dave said, at least for a confusing reason, don't give the same name. chordSymbols[row][col] with an S seems more appropriate

        Can't help pressing F5 in the forum...

        VirtualVirginV 1 Reply Last reply Reply Quote 0
        • VirtualVirginV
          VirtualVirgin @ustk
          last edited by

          @ustk said in Are "var" variables inside a paint routine inside a namespace leaky?:

          @VirtualVirgin Is the Paint Routine related the same panel that is in CSU?

          If yes, then since you do:

          panel.getValue().chordSymbol[row][col] = chordSymbol;
          

          Shouldn't the proper way to get it back be:

          var chordSymbol = this.getValue().chordSymbol[row][col];
          

          They are completely different panels. Just the local use of "panel" for widgets.

          You can listen to my orchestral mockups here:
          https://www.virtualvirgin.net/

          ustkU VirtualVirginV 2 Replies Last reply Reply Quote 1
          • ustkU
            ustk @VirtualVirgin
            last edited by ustk

            @VirtualVirgin ok, so what is pads here .pads[row][col]? Does it hold a panel? because calling getValue() on it seems weird without knowing more...

            Can't help pressing F5 in the forum...

            1 Reply Last reply Reply Quote 0
            • VirtualVirginV
              VirtualVirgin @d.healey
              last edited by VirtualVirgin

              @d-healey said in Are "var" variables inside a paint routine inside a namespace leaky?:

              @VirtualVirgin said in Are "var" variables inside a paint routine inside a namespace leaky?:

              And given that the inline function works while breaking the paint routine in the other namespace would make it seem like the local "chordSymbol" variable is the one that is leaking...?

              Did you try changing chordSymbol to a different name temporarily to see if the error goes away?

              So I went through each line in the inline function and found the trouble.
              One of the lines was returning an "undefined" because I did not initialize the data storage for it properly,
              and once that was in the mix it threw errors for things down the line that were being loaded as persistent data.
              The confusion occurred because the error that was coming up in the console is not where the root of the error was taking place,
              just a subsequent error being caused by an external script getting detached I think.

              TLDR - no leaky variables here.

              You can listen to my orchestral mockups here:
              https://www.virtualvirgin.net/

              d.healeyD 1 Reply Last reply Reply Quote 1
              • VirtualVirginV VirtualVirgin marked this topic as a question on
              • VirtualVirginV VirtualVirgin has marked this topic as solved on
              • VirtualVirginV
                VirtualVirgin @VirtualVirgin
                last edited by

                @VirtualVirgin said in Are "var" variables inside a paint routine inside a namespace leaky?:

                @ustk said in Are "var" variables inside a paint routine inside a namespace leaky?:

                @VirtualVirgin Is the Paint Routine related the same panel that is in CSU?

                If yes, then since you do:

                panel.getValue().chordSymbol[row][col] = chordSymbol;
                

                Shouldn't the proper way to get it back be:

                var chordSymbol = this.getValue().chordSymbol[row][col];
                

                They are completely different panels. Just the local use of "panel" for widgets.

                Yes, that is a panel.

                You can listen to my orchestral mockups here:
                https://www.virtualvirgin.net/

                1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @VirtualVirgin
                  last edited by

                  @VirtualVirgin said in Are "var" variables inside a paint routine inside a namespace leaky?:

                  The confusion occurred because the error that was coming up in the console is not where the root of the error was taking place,

                  Turning on stack trace in project preferences might help here.

                  Libre Wave - Freedom respecting instruments and effects
                  My Patreon - HISE tutorials
                  YouTube Channel - Public HISE tutorials

                  VirtualVirginV 1 Reply Last reply Reply Quote 0
                  • VirtualVirginV
                    VirtualVirgin @d.healey
                    last edited by

                    @d-healey I'm curious. Where do I find that feature? I'm looking in the Docs for "preferences" and not finding anything.

                    You can listen to my orchestral mockups here:
                    https://www.virtualvirgin.net/

                    d.healeyD 2 Replies Last reply Reply Quote 0
                    • d.healeyD
                      d.healey @VirtualVirgin
                      last edited by

                      @VirtualVirgin might be called call stack, it's in project preferences

                      Libre Wave - Freedom respecting instruments and effects
                      My Patreon - HISE tutorials
                      YouTube Channel - Public HISE tutorials

                      1 Reply Last reply Reply Quote 0
                      • d.healeyD
                        d.healey @VirtualVirgin
                        last edited by

                        @VirtualVirgin This one

                        e1be96eb-6f9e-4dd0-9787-6ced41f024d8-image.png

                        You might also simplify your code a little by using a helper function or two for your panel data management.

                        For example a generic function to set a property in your 3D array structure.

                        inline function setPanelData(panel, key, row, col, value)
                        {
                            panel.getValue()[key][row][col] = value;
                        }
                        

                        Libre Wave - Freedom respecting instruments and effects
                        My Patreon - HISE tutorials
                        YouTube Channel - Public HISE tutorials

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        18

                        Online

                        1.8k

                        Users

                        12.0k

                        Topics

                        104.4k

                        Posts