MCPcopy Create free account
hub / github.com/defold/defold / DeleteCollection

Function DeleteCollection

engine/gameobject/src/gameobject/gameobject.cpp:583–604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

581 }
582
583 void DeleteCollection(Collection* collection)
584 {
585 DM_PROFILE("DeleteCollection");
586
587 // We mark the collection as beeing deleted here to avoid component
588 // triggered recursive deletes to add gameobjects to the delayed delete list.
589 //
590 // For example, deleting a Spine component would mark bone gameobjects
591 // to be deleted next frame. However, since DoDeleteAll just deletes all
592 // instances directly, the entries in the "delayed delete list" might already
593 // have been deleted, making it impossible to add the spine bones to this list.
594 collection->m_ToBeDeleted = 1;
595
596 FinalCollection(collection);
597 DoDeleteAll(collection);
598 ReleaseDynamicResources(collection);
599
600 HCollection hcollection = collection->m_HCollection;
601 DetachCollection(collection);
602 DeallocCollection(collection);
603 delete hcollection;
604 }
605
606 // Really should be renamed "DelayDelete"
607 void DeleteCollection(HCollection hcollection)

Callers 15

DeleteCollectionsFunction · 0.85
AttachCollectionFunction · 0.85
PostUpdateFunction · 0.85
AcquireResourcesFunction · 0.85
ResCollectionDestroyFunction · 0.85
ResCollectionRecreateFunction · 0.85
TearDownMethod · 0.85
TearDownMethod · 0.85
TearDownMethod · 0.85
TEST_FFunction · 0.85
TearDownMethod · 0.85
TearDownMethod · 0.85

Calls 5

FinalCollectionFunction · 0.85
DoDeleteAllFunction · 0.85
ReleaseDynamicResourcesFunction · 0.85
DetachCollectionFunction · 0.85
DeallocCollectionFunction · 0.85

Tested by 15

TearDownMethod · 0.68
TearDownMethod · 0.68
TearDownMethod · 0.68
TEST_FFunction · 0.68
TearDownMethod · 0.68
TearDownMethod · 0.68
TearDownMethod · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TearDownMethod · 0.68
TearDownMethod · 0.68
TearDownMethod · 0.68