Access Violation Crash happens at SUModelRelease()

Hi Experts,

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)

Could you please take a look at the issues?


Is that all you do?
Can you please post a complete snippet to reproduce?

Hi Expert,

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.


Can you provide a sample project?

Hey tt_su,

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)

Any help would be appreciated :slight_smile:

Best Regards,

Ya’ll need to be including the SDK version(s) showing the issue, when ya’ post an report, please.

For example, the original poster, was most likely reporting against the 15.0 SDK release. So, Garry, are seeing the same issue with the 16.1 release ?

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.



Hey tt_su,

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?


Hmm… that didn’t crash when I tested it. What computer system do you have? OS version etc?

SUModelFixErrors will have some overhead, yes.


Windows 10 x64, SDK 18.0.16975.0 + Sketchup 2018 PRO

Minimal model (based on internal.skp)
internal_minimal.skp (11.0 KB)

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.


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

No such API right now. You could file a feature request for it.