MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / context_destroy

Function context_destroy

context.c:81–114  ·  view source on GitHub ↗

Note: @ctx will *not* be freed! */

Source from the content-addressed store, hash-verified

79
80/* Note: @ctx will *not* be freed! */
81void context_destroy(enum osips_context ctxtype, context_p ctx)
82{
83 int f = 0;
84 int n;
85 int i;
86 str *s;
87 void *p;
88
89
90 /* int ctx */
91 for (n = 0; n < type_sizes[ctxtype][CONTEXT_INT_TYPE]; n++, f++)
92 if (context_destroy_array[ctxtype][f]) {
93 i = context_get_int(ctxtype, ctx, n);
94 if (i)/* XXX: should we call for 0 values? */
95 context_destroy_array[ctxtype][f](&i);
96 }
97
98 /* str ctx */
99 for (n = 0; n < type_sizes[ctxtype][CONTEXT_STR_TYPE]; n++, f++)
100 if (context_destroy_array[ctxtype][f]) {
101 s = context_get_str(ctxtype, ctx, n);
102 if (s)/* XXX: how do we determine if s is empty? */
103 context_destroy_array[ctxtype][f](s);
104 }
105
106 /* ptr ctx */
107 for (n = 0; n < type_sizes[ctxtype][CONTEXT_PTR_TYPE]; n++, f++) {
108 if (context_destroy_array[ctxtype][f]) {
109 p = context_get_ptr(ctxtype, ctx, n);
110 if (p)
111 context_destroy_array[ctxtype][f](p);
112 }
113 }
114}
115
116context_p context_alloc(enum osips_context type)
117{

Callers 15

clear_global_contextFunction · 0.85
run_top_routeFunction · 0.85
t_resume_async_requestFunction · 0.85
t_resume_async_replyFunction · 0.85
free_cellFunction · 0.85
final_response_handlerFunction · 0.85
b2bl_deleteFunction · 0.85
dual_bye_eventFunction · 0.85
send_leg_byeFunction · 0.85
send_leg_msgFunction · 0.85

Calls 3

context_get_intFunction · 0.85
context_get_strFunction · 0.85
context_get_ptrFunction · 0.85

Tested by

no test coverage detected