Rhino8 takes a very long time to close. Bug? Or improper object disposal?

I’ve had this problem randomly for a very long time. Sometimes Rhino8 takes a long time to close…even if the file is very simple. Not every time, but often. I think it has even happened with empty files. This whole time, I’ve assumed it was a bug that would eventually be fixed. But yesterday, it took several minutes to close and, for the first time, it crossed my mind that perhaps the scripts that I’m working on are causing this (due to not disposing of objects).

So, are others seeing Rhino take a long time to close (in which case it’s likely a bug) and also can failing to dispose of objects made in RhinoCommon cause a long close time even if there are only a few objects in the actual document?

Hi @webdunce,

What 3rd party plug-ins are you using? If you disable these, does Rhino close faster?

– Dale

Hi @dale ,

Thanks for following up on this. I’ll attach my system info text, but so far as I know, I don’t have any plug-ins.

I think the issue was caused by my scripts. I have a set of python scripts, most of which use the display pipeline and they generate a lot of Rhino.Geometry objects in response to sliders in ETO forms (my attempt to kind of emulate Grasshopper functionality). And I had not been calling Dispose() on these objects, assuming that they’d be garbage-collected at the script’s termination. I’ve gone through those scripts and found as many objects as I could and called Dispose() on them. And that seems to have solved the long-close issue I was experiencing. Although, if it becomes a problem again, I’ll let you all know.

Going forward, I’m trying to track any objects that need to be disposed of in lists, so I can be sure to dispose of them every time my Solve() method is called and also one final time whenever before the form closes.

When working with the display pipeline, I feel like the proverbial bull in a china shop. If there is any documentation or examples on best practices for managing objects in the display pipeline or even just object management in general when scripting with Rhino.Geometry objects, I’d love to look at it.

system_info.txt (2.5 KB)

1 Like