From 956ee5ae9d2232ea05231902aef767c9a1555ffe Mon Sep 17 00:00:00 2001 From: Moses Turner Date: Sun, 18 Sep 2022 08:10:43 -0500 Subject: [PATCH] d/ns: Allow for freeing the 3D optical system --- .../north_star/distortion_3d/deformation_northstar.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/xrt/drivers/north_star/distortion_3d/deformation_northstar.cpp b/src/xrt/drivers/north_star/distortion_3d/deformation_northstar.cpp index a25828498..c5223e8f5 100644 --- a/src/xrt/drivers/north_star/distortion_3d/deformation_northstar.cpp +++ b/src/xrt/drivers/north_star/distortion_3d/deformation_northstar.cpp @@ -267,6 +267,14 @@ ns_3d_create_optical_system(struct ns_3d_eye *eye) return (struct ns_optical_system *)opticalSystem; } +extern "C" void +ns_3d_free_optical_system(struct ns_optical_system **system) +{ + OpticalSystem *cast_sys = (OpticalSystem *)*system; + delete cast_sys; + *system = NULL; +} + extern "C" void ns_3d_display_uv_to_render_uv(struct xrt_vec2 in, struct xrt_vec2 *out, struct ns_3d_eye *eye) {