MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / ~Components

Method ~Components

src/components/Components.cpp:41–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41Components::~Components() {
42
43 // If there are allocated components
44 if (mNbAllocatedComponents > 0) {
45
46 // Destroy all the remaining components
47 for (uint32 i = 0; i < mNbComponents; i++) {
48
49 destroyComponent(i);
50 }
51
52 // Size for the data of a single component (in bytes)
53 const size_t totalSizeBytes = mNbAllocatedComponents * mComponentDataSize;
54
55 // Release the allocated memory
56 mMemoryAllocator.release(mBuffer, totalSizeBytes);
57 }
58}
59
60// Initialize the components:
61void Components::init() {

Callers

nothing calls this directly

Calls 1

releaseMethod · 0.45

Tested by

no test coverage detected