diff --git a/daemon/media_socket.c b/daemon/media_socket.c index 58c2cb101..2ba763335 100644 --- a/daemon/media_socket.c +++ b/daemon/media_socket.c @@ -3433,7 +3433,7 @@ enum thread_looper_action kernel_stats_updater(void) { while (kl) { ke = kl->data; kernel2endpoint(&ep, &ke->target.local); - AUTO_CLEANUP(stream_fd *sfd, stream_fd_auto_cleanup) = stream_fd_lookup(&ep); + g_autoptr(stream_fd) sfd = stream_fd_lookup(&ep); if (!sfd) goto next; diff --git a/include/media_socket.h b/include/media_socket.h index f1b11a4ec..7691f03b7 100644 --- a/include/media_socket.h +++ b/include/media_socket.h @@ -361,11 +361,13 @@ INLINE int proto_is(const struct transport_protocol *protocol, enum transport_pr return 0; return (protocol->index == idx) ? 1 : 0; } -INLINE void stream_fd_auto_cleanup(stream_fd **sp) { - if (!*sp) +INLINE void stream_fd_put(stream_fd *sp) { + if (!sp) return; - obj_put(*sp); + obj_put(sp); } +G_DEFINE_AUTOPTR_CLEANUP_FUNC(stream_fd, stream_fd_put) + #endif