Skip to content

Commit cf38ee0

Browse files
committed
MT#55283 change obj_release to inline
to avoid compiler warnings Change-Id: I0cecb3bb03297616ddd4f376abf68dcceb1c8a99
1 parent c70c8b4 commit cf38ee0

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

daemon/call.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5069,7 +5069,7 @@ static void __call_cleanup(call_t *c) {
50695069
media_player_put(&ml->rec_player);
50705070
if (ml->tone_freqs)
50715071
g_array_free(ml->tone_freqs, true);
5072-
obj_release_o(ml->janus_session);
5072+
obj_release(ml->janus_session);
50735073
}
50745074

50755075
while (c->stream_fds.head) {

daemon/codec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2092,7 +2092,7 @@ void mqtt_timer_start(struct mqtt_timer **mqtp, call_t *call, struct call_media
20922092
static void codec_timer_stop(struct codec_timer **ctp) {
20932093
if (!ctp)
20942094
return;
2095-
obj_release_o(*ctp);
2095+
obj_release(*ctp);
20962096
}
20972097
// master lock held in W
20982098
void rtcp_timer_stop(struct rtcp_timer **rtp) {

lib/obj.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,15 @@ INLINE void __obj_put(struct obj *o);
109109
#define obj_alloc(t,f) obj_alloc_full(t, f, g_malloc, (void (*)(t *)) g_free)
110110
#define obj_alloc0(t,f) obj_alloc_full(t, f, g_malloc0, (void (*)(t *)) g_free)
111111

112-
#define obj_release_o(op) do { if (op) obj_put_o((struct obj *) op); op = NULL; } while (0)
113-
#define obj_release(op) do { if (op) obj_put(op); op = NULL; } while (0)
112+
INLINE void __obj_release(struct obj **o) {
113+
if (!*o)
114+
return;
115+
obj_put_o(*o);
116+
*o = NULL;
117+
}
118+
119+
#define obj_release_o(op) __obj_release(&(op))
120+
#define obj_release(op) __obj_release((struct obj **) &(op))
114121

115122
INLINE void obj_put_gen(struct obj *o) {
116123
obj_put_o(o);

0 commit comments

Comments
 (0)