Fusion icon indicating copy to clipboard operation
Fusion copied to clipboard

`applyInstanceProps.setProperty` seems to be called after an instance's destruction in some cases

Open dphfox opened this issue 3 years ago • 0 comments

I was getting some unexpected errors from inside Fusion recently, so I added a check to setProperty for nil references in the event of an error.

What I found is that, after disappearing, some of my instances seemed to emit errors, which I could reliably provoke:

05:04:45.267  [Fusion] `applyInstanceProps.setProperty` got a nil ref while setting Size to 2.140533447265625, 2.140533447265625, 1.0702667236328125 (this is an internal issue)
    (ID: setPropertyNilRef)
  05:04:45.268  Stack Begin
  05:04:45.268  Script 'Plugin.Libraries.Fusion.Logging.logError', Line 29 - function logError
  05:04:45.268  Script 'Plugin.Libraries.Fusion.Instances.applyInstanceProps', Line 38 - function setProperty
  05:04:45.268  Script 'Plugin.Libraries.Fusion.Instances.applyInstanceProps', Line 62
  05:04:45.268  Stack End

While I don't have concrete evidence for this, I believe that setProperty is being called after an instance is garbage collected (or at least after its reference is). This indicates there's something wrong with our cleanup code.

Most likely related to #125.

dphfox avatar Apr 22 '22 04:04 dphfox