Dreamteck / splines

The official Dreamteck Splines for Unity repository
Apache License 2.0
22 stars 2 forks source link

ObjectBenderEditor leaks callbacks #11

Closed Kronoxis closed 7 months ago

Kronoxis commented 10 months ago

See Discord thread

The ObjectBenderEditor does not call its base.OnDestroy method, which causes it to leak the DuringSceneGUI method to the SceneView, and in turn errors when the ObjectBender gets destroyed, as well as causing performance issues over time as the GUI gets called many times per SceneView update.

Adding the following line fixes the issues: https://github.com/Dreamteck/splines/blob/d9097728db1181f11619c53eabce2bbc26389d01/Assets/Dreamteck/Splines/Editor/Components/ObjectBenderEditor.cs#L342-L343

+            base.OnDestroy();

https://github.com/Dreamteck/splines/blob/d9097728db1181f11619c53eabce2bbc26389d01/Assets/Dreamteck/Splines/Editor/Components/ObjectBenderEditor.cs#L344-L354

GMihalkow commented 7 months ago

@Kronoxis thank you for the fix