MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / Schema_Free

Function Schema_Free

src/schema/schema.c:768–805  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

766}
767
768void Schema_Free
769(
770 Schema *s
771) {
772 ASSERT(s != NULL);
773
774 if(s->name) {
775 rm_free(s->name);
776 }
777
778 // free constraints
779 if(s->constraints != NULL) {
780 uint n = array_len(s->constraints);
781 for(uint i = 0; i < n; i++) {
782 Constraint_Free(s->constraints + i);
783 }
784 array_free(s->constraints);
785 }
786
787 // free indicies
788 if(PENDING_FULLTEXT_IDX(s) != NULL) {
789 Index_Free(PENDING_FULLTEXT_IDX(s));
790 }
791
792 if(ACTIVE_FULLTEXT_IDX(s) != NULL) {
793 Index_Free(ACTIVE_FULLTEXT_IDX(s));
794 }
795
796 if(PENDING_EXACTMATCH_IDX(s)) {
797 Index_Free(PENDING_EXACTMATCH_IDX(s));
798 }
799
800 if(ACTIVE_EXACTMATCH_IDX(s) != NULL) {
801 Index_Free(ACTIVE_EXACTMATCH_IDX(s));
802 }
803
804 rm_free(s);
805}
806

Callers 2

_GraphContext_FreeFunction · 0.85

Calls 5

rm_freeFunction · 0.85
array_lenFunction · 0.85
Constraint_FreeFunction · 0.85
array_freeFunction · 0.85
Index_FreeFunction · 0.85

Tested by

no test coverage detected