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

Function SinglePairCtx_Free

src/procedures/proc_sp_paths.c:68–86  ·  view source on GitHub ↗

free SinglePairCtx

Source from the content-addressed store, hash-verified

66
67// free SinglePairCtx
68static void SinglePairCtx_Free
69(
70 SinglePairCtx *ctx
71) {
72 if(ctx == NULL) return;
73
74 uint32_t levelsCount = array_len(ctx->levels);
75 for(int i = 0; i < levelsCount; i++) array_free(ctx->levels[i]);
76 if(ctx->levels) array_free(ctx->levels);
77 if(ctx->path) Path_Free(ctx->path);
78 if(ctx->neighbors) array_free(ctx->neighbors);
79 if(ctx->relationIDs) {
80 array_free(ctx->relationIDs);
81 }
82 if(ctx->path_count == 0 && ctx->array != NULL) array_free(ctx->array);
83 else if(ctx->path_count > 1 && ctx->heap != NULL) Heap_free(ctx->heap);
84 array_free(ctx->output);
85 rm_free(ctx);
86}
87
88// initialize returned values pointers
89static void _process_yield

Callers 2

Proc_SPpathsInvokeFunction · 0.85
Proc_SPpathsFreeFunction · 0.85

Calls 5

array_lenFunction · 0.85
array_freeFunction · 0.85
Path_FreeFunction · 0.85
Heap_freeFunction · 0.85
rm_freeFunction · 0.85

Tested by

no test coverage detected