Solved Damaged block

Hello!

When C4D R20 is closing while debugging in XCode, it's triggering an EXC_BREAKPOINT in the GeData destructor:

c4d_gedata.h:333 C4DOS.Gd->Free(this);

I can see this in the console...

/Volumes/Branches/build_osx/osx-4-release/depot/release/20.0/frameworks/kernel.framework/source/memory/systemallocator.cpp(487): CRITICAL: Stop: Damaged block (or from a different allocator

What should be I looking for to fix this?

Hi Roger, thanks for reaching out us.

With regard to this issue, might it be connected to what we've already discussed here?
Are you maybe using any approach different from those we describe in our documentation with regard to entity creation on MAXON API or classic API?

Last but not least I also recommend to see here how memory allocation is supposed to be managed in MAXON API.

Finally feel free to provide a snippet in order to replicate the behavior.

Best, Riccardo

@r_gigante said in Damaged block:

With regard to this issue, might it be connected to what we've already discussed here?

I don't think so, tis has been happening since before that was implemented.

I had this same issue with the String destructor. I removed the issue by replacing all std containers members I had with String (std::vector<String>) for std::string (std::vector<std::string>). That fixed the issue. I did the same for GeData, but I still have this debug breakpoint on XCode.

@r_gigante said in Damaged block:

Finally feel free to provide a snippet in order to replicate the behavior.

We already have a pretty big amount of plugin code, unfortunately have no clue which GeData is giving me problems.

It's just a breakpoint, not a real problem right now, but would be good to understand what's happening, that could be a potential error in the future.

Hi Roger, thanks for following up.

Although I've run a few tests here trying to mix-up STL data-types and Cinema API ones, I wasn't able to reproduce the issue on Xcode 9.4.1 and Cinema R20.057.

That said, where possible, we encourage sticking to Cinema 4D API related data-types in order to grant better performance and superior stability.
In your specific case I would go for maxon::BaseArray rather than std::vector and I would have switched from std::vector<std::string> to maxon::BaseArray<maxon::String>

Would this be an option?
Would you like to share a portion of code to reproduce the issue?

Best, Riccardo