diff --git a/crates/header-translator/src/stmt.rs b/crates/header-translator/src/stmt.rs index b103158ec..0a2a9e71b 100644 --- a/crates/header-translator/src/stmt.rs +++ b/crates/header-translator/src/stmt.rs @@ -1587,9 +1587,10 @@ impl Stmt { }); // Don't map `CFRetain`, `CFRelease`, `CFAutorelease`, as well - // as custom ones like as `CGColorRelease`. + // as custom ones like as `CGColorRelease`, but not things + // like `CMBufferQueueDequeueAndRetain`. // - // Same as what Swift does: + // Roughly the same as what Swift does: // // // Users can achieve (almost) the same by using `CFRetained` @@ -1598,9 +1599,10 @@ impl Stmt { // Besides, these do not have the necessary memory management // attributes (cf_consumed/cf_returns_retained), and as such // cannot be mapped correctly without extra hacks. - if id.name.ends_with("Retain") + if (id.name.ends_with("Retain") || id.name.ends_with("Release") - || id.name.ends_with("Autorelease") + || id.name.ends_with("Autorelease")) + && !id.name.ends_with("AndRetain") { if let Some((_, first_arg_ty)) = arguments.first() { if first_arg_ty.is_cf_type() { diff --git a/generated b/generated index 4a41d5efb..2779d0dbb 160000 --- a/generated +++ b/generated @@ -1 +1 @@ -Subproject commit 4a41d5efbf260b81f2cf970d4d110fcf0fe5040f +Subproject commit 2779d0dbbc628dc62604c59e20046bf711c79909