Skip to content

Conversation

@Saschl
Copy link
Contributor

@Saschl Saschl commented Mar 26, 2025

Just for information, it's not complete and breaks 2020 compatibility

sys::fsVarsAircraftVarGet(self.simvar, self.units, params_for_get, &mut v);

// drop the mem
drop(Box::from_raw(params_for_get.array));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the drop is not needed here. I experimented a lot as I initially thought some of the issues I encountered were caused by memory issues, but that was not the case.


array.push(sys::FsVarParamVariant {
type_: sys::eFsVarParamType_FsVarParamTypeInteger,
__bindgen_anon_1: sys::FsVarParamVariant__bindgen_ty_1 {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugly, but that's what bindgen gives us here. Guess it happens because there's no anonymous unions in rust

});

let params_for_set = sys::FsVarParamArray {
size: 1,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can hold more than one obviously :D Was enough for our use case, but should be handled properly

};

self.executor.send(Some(data)).unwrap();
/* sys::PANEL_SERVICE_POST_KILL => self.executor.send(None).is_ok(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed for 2024 systems as the callbacks are separated now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants