Under OSX Eto form can crash Rhino

Hello,

I think I have found a bug under Rhino 6 OSX, which is probably related to Eto forms.

This is a sample code (a very simple custom material, but the same with custom environment crashes too)

To trigger the bug:

  1. Go to Material Panel
  2. Add a new “My Material” material
  3. On the menu of the panels view (top right corner) switch to “Show properties panel”
  4. crash…
namespace myNamespace
{
    [Guid("172AF225-1231-11A8-8D66-9B15ECE3E52F")]
    [CustomRenderContent(IsPrivate = false)]
    public class MyMaterial : RenderMaterial
    {
        public override string TypeName => "My Material";
        public override string TypeDescription => "My Material";

        public static List<Rhino.UI.Controls.EtoCollapsibleSection> _sections = new List<Rhino.UI.Controls.EtoCollapsibleSection>();

        protected override void OnAddUserInterfaceSections()
        {
            _sections.Clear();

            _sections.Add(new SectNew());

            foreach (var section in _sections)
                AddUserInterfaceSection(section);
        }

        public MyMaterial()
        {
            ModifyRenderContentStyles(RenderContentStyles.None, RenderContentStyles.TextureSummary);
        }

        public class SectNew : Rhino.UI.Controls.EtoCollapsibleSection
        {

            public override Rhino.UI.LocalizeStringPair Caption => new Rhino.UI.LocalizeStringPair("title", "title");

            public override int SectionHeight => 100;
        };
    };
};

Márton

Edited your post to use proper code quoting in tripple backticks.

Thanks for correcting the format of it:).

It seems this issue (or probably the same) comes up at more places during a Rhino workflow and it can affect Rhino stability seriously.

For example when the user tries to assign a custom plugin material to a layer. User clicks on the little circle icon (on layer panel), the modal dialog comes up. Selecting there the custom material (in my example code the MyMaterial material) crashes Rhino instantly.

Hi @marton.parlagh,

I’ve opened an issue so someone can look into this.

https://mcneel.myjetbrains.com/youtrack/issue/RH-56323

– Dale

@marton.parlagh I can reproduce this. I will fix this. Thanks for the code snippet.

Ohhh, Great news!

Thank you!

Márton

This bug:

RH-56323 RDK: Under OSX Eto form can crash Rhino

should be fixed in the latest Rhino 6 for Mac Release Candidates. Thanks again for reporting this.

Thanks for fixing it!

Márton