angelsix / solidworks-api

C# SolidWorks API stuff
Other
266 stars 121 forks source link

Internal exception thrown "RaceOnRCWCleanup" #44

Closed doronkind closed 6 years ago

doronkind commented 6 years ago

After updrading from 1.0.0.9 to 1.0.1 version I am getting a following warning:

Managed Debugging Assistant 'RaceOnRCWCleanup' : 'An attempt has been made to free an RCW that is in use. The RCW is in use on the active thread or another thread. Attempting to free an in-use RCW can cause corruption or data loss.'

Here is a step image

There are no any changes in thread usages or something else. Just the version updrading.

angelsix commented 6 years ago

Gotta love SolidWorks. Fix one thing break another.

Fixed now https://github.com/angelsix/solidworks-api/commit/32359c22cec9027def525591b7248757164ebf12

Was due to the fact SolidWorks doesn't fire a FileSave event ever, anywhere, if you create a new part. I can also find no events anywhere that fire during that case. If I have a fix here https://github.com/angelsix/solidworks-api/commit/32359c22cec9027def525591b7248757164ebf12#diff-eb2d2b8afc4dda8e379b2faecad78195R673

Nuget 1.0.1.4 has the fix in so just update

doronkind commented 6 years ago

Thank you, I'll try to update and notify you if something get wrong.