fmod/studio/command_replay/general.rs
1// Copyright (c) 2024 Lily Lyons
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
7use fmod_sys::*;
8
9use crate::studio::CommandReplay;
10
11impl CommandReplay {
12 /// Releases the command replay.
13 pub fn release(self) -> Result<()> {
14 #[cfg(feature = "userdata-abstraction")]
15 let userdata = self.get_raw_userdata()?;
16
17 unsafe {
18 FMOD_Studio_CommandReplay_Release(self.inner).to_result()?;
19 }
20
21 #[cfg(feature = "userdata-abstraction")]
22 if !userdata.is_null() {
23 crate::userdata::remove_userdata(userdata.into());
24 }
25
26 Ok(())
27 }
28}