Hi,
In my experience the C++ crashes are duo to bad memory management.
Fusion360 API calls commonly return objects, which need to be managed according to the objects types and checking they are not null before making any operation. So, I'd suggest to always verify it is NOT NULL before accessing them, and make sure you are using the correct object type when received from a API call.
You can use:
adsk.core.Application.log(message, level, type) |
with
type = adsk.core.LogTypes.FileLogType to log messages to Fusion log file.
Using the text command "paths.get" you can know the current log file, looking for the key "AppLogFilePath" on that output:
You can also write messages to some other log file, making sure you flushes it before making any new operation, so you could keep the message in the file before the process crashes.
Hope this help.
Regards,
Jorge