We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 652bab0 commit b10f1efCopy full SHA for b10f1ef
cocoa/src/quartzcore.rs
@@ -65,7 +65,11 @@ impl CALayer {
65
66
#[inline]
67
pub fn new() -> CALayer {
68
- unsafe { CALayer(msg_send![class!(CALayer), layer]) }
+ unsafe {
69
+ let id: id = msg_send![class!(CALayer), layer];
70
+ let _: id = msg_send![id, retain];
71
+ CALayer(id)
72
+ }
73
}
74
75
@@ -1680,3 +1684,15 @@ pub type CVSMPTETimeFlags = u32;
1680
1684
1681
1685
pub const kCVSMPTETimeValid: CVSMPTETimeFlags = 1 << 0;
1682
1686
pub const kCVSMPTETimeRunning: CVSMPTETimeFlags = 1 << 1;
1687
+
1688
+#[cfg(test)]
1689
+mod test {
1690
+ use super::CALayer;
1691
1692
+ #[test]
1693
+ fn create_calayer() {
1694
+ objc::rc::autoreleasepool(|| {
1695
+ let _ = CALayer::new();
1696
+ });
1697
1698
+}
0 commit comments