Let me start by saying that I have no surefire way to reproduce this. But maybe it is useful anyway.
I had a piece of code that created a Mesh object and put values in its UserDictionary in the DrawForeground method of a DisplayConduit. To the credit of Rhino this did not noticably delay redrawing, even though a Mesh object with up to several thousand faces was created at every redraw frame. Recently (maybe with the introduction of SR7, I’m not sure) this started to behave erratically. Crashes would ensue, giving us no clear way to know what was going on.
Then, today I got a clear exception report saying the following
with stacktrace (the piece inside RhinoCommon is reproduced)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at Rhino.DocObjects.Custom.UserData.StoreInRuntimeList(UserData ud) at Rhino.DocObjects.Custom.UserDataList.Add(UserData userdata) at Rhino.Runtime.CommonObject.get_UserDictionary()
I haven’t been able to reproduce this again unfortunately.
I have adapted my DrawForeground code though, that is uses a cached Mesh representation rather than create a mesh at each frame redraw.