When importing the attached skp file into my application, the crash happened at SketchUp toolkit when releasing skp model. I tried to do two things: call skp function “SUModelCreateFromFile()” to create skp model; then call skp function SUModelRelease() to release skp model; the crash is reproducecontador.skp (2.2 MB)
It isn’t all I do. In fact I do lots of operations after calling SUModelCreateFromFile()" such as handling component, group etc. The crash is in the function “SUModelRelease()”. I can reproduce the crash only by calling these two functions.
we experience the same problem.
We stripped down the code, and the only thing that happens now is
a SUModelCreateFromFile() call followed by SUModelRelease(),
which results in Access Violation. (C++/x64/VS2010)
We had stable import for a long time, it shouldn’t be an implementation problem.
Attached is the first model we found affected so far.internal.skp (1.2 MB)
Been a while since I’ve been on the forum and was browsing old threads. Both of the .skp files in this thread crash SketchUp (16.1.1449 x64) on my pc on exit. I sent in a crash report for contador.skp.
You know, I should add that I had a similar crash issue to this with writing to SketchUp from Rhino. That crash was caused by what I assume was a double delete in SUModelRelease. I had “released” a component where SUEntitiesFill failed that had already been added to the model via SUModelAddComponentDefinitions. When I quit doing that the crash went away. I figured better to leak than to crash.
In the page, Crash at SUModelRelease(SUModelRef*), you mentioned
“the SU2018 version of the SDK have a new function SUModelFixErrors which allows you to trigger the Fix Model functionally from the C API as well.”
I try to call the new function after calling SUModelCreateFromFile(&model, “contador.skp”), it turned out the crash happens on the new function.
I have another question. Is there any performance issue if always call the new function?
This file crashes (BugSplat after close) SU2018 Pro if the model wasn’t fixed.
If the model was fixed under SU, invalid face was removed, the model start working (no bugsplat).
Validity Check report.
EDIT:
It looks like if we re-save file, under SU2016 - SU2018 (even that SU got a bug splat after close), file is updated and SUModeleRelease doesn’t throw an exception (on original SKP2015 it does).
By the way: @tt_su: Is it possible to check if model contains any errors before call to SUModelFixErrors?
SU when loading file can check if model contains any errors and popups the message. Is any equivalent CAPI function for this, or we need always call SUModelFixErrors which is a quit unnecessary overhead in most cases? Should we create a feature request for SUModelCreateFromFile for extra parameters hasErrors