From 78dbbec8914e57b37039fcad9dd41a7d94da598a Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 15 Feb 2021 15:33:41 +0000 Subject: [PATCH] st/prober: Improve xrt_prober_destroy --- src/xrt/include/xrt/xrt_prober.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xrt/include/xrt/xrt_prober.h b/src/xrt/include/xrt/xrt_prober.h index d0410158b..8e3169a85 100644 --- a/src/xrt/include/xrt/xrt_prober.h +++ b/src/xrt/include/xrt/xrt_prober.h @@ -361,7 +361,8 @@ xrt_prober_list_video_devices(struct xrt_prober *xp, xrt_prober_list_video_cb cb /*! * @copydoc xrt_prober::destroy * - * Helper function for @ref xrt_prober::destroy. + * Helper for calling through the function pointer: does a null check and sets + * xp_ptr to null if freed. * * @public @memberof xrt_prober */ @@ -374,6 +375,7 @@ xrt_prober_destroy(struct xrt_prober **xp_ptr) } xp->destroy(xp_ptr); + *xp_ptr = NULL; } /*!