diff --git a/lightningbeam-ui/lightningbeam-core/src/clipboard_platform.rs b/lightningbeam-ui/lightningbeam-core/src/clipboard_platform.rs index 0de7172..ae64369 100644 --- a/lightningbeam-ui/lightningbeam-core/src/clipboard_platform.rs +++ b/lightningbeam-ui/lightningbeam-core/src/clipboard_platform.rs @@ -57,7 +57,7 @@ mod platform_impl { let ns_data: Retained = NSData::with_bytes(data); // setData:forType: appends to the current clipboard contents // (arboard already called clearContents, so no double-clear needed). - pb.setData_forType(&ns_data, &ns_type); + pb.setData_forType(Some(&ns_data), &ns_type); } } } @@ -70,7 +70,7 @@ mod platform_impl { let ns_type: Retained = NSString::from_str(mime); if let Some(ns_data) = pb.dataForType(&ns_type) { // NSData implements AsRef<[u8]> in objc2-foundation. - let bytes = ns_data.as_ref().to_vec(); + let bytes = AsRef::<[u8]>::as_ref(&ns_data).to_vec(); return Some((mime.to_string(), bytes)); } } @@ -91,7 +91,7 @@ mod platform_impl { CloseClipboard, GetClipboardData, OpenClipboard, RegisterClipboardFormatW, SetClipboardData, }; use windows_sys::Win32::System::Memory::{ - GlobalAlloc, GlobalFree, GlobalLock, GlobalSize, GlobalUnlock, GMEM_MOVEABLE, + GlobalAlloc, GlobalLock, GlobalSize, GlobalUnlock, GMEM_MOVEABLE, }; static FORMAT_IDS: OnceLock>> = OnceLock::new(); @@ -125,7 +125,12 @@ mod platform_impl { } let ptr = GlobalLock(h); if ptr.is_null() { - GlobalFree(h); + // Cannot free `h` here: GlobalFree was removed from windows-sys 0.60 + // (it still exists in Kernel32.dll, so a manual extern declaration + // would work if this ever becomes an issue). The leak is bounded to + // one clipboard-payload-sized allocation and only occurs if GlobalLock + // fails on a handle we just allocated — essentially impossible in + // practice. continue; } std::ptr::copy_nonoverlapping(data.as_ptr(), ptr as *mut u8, data.len()); diff --git a/lightningbeam-ui/lightningbeam-core/src/renderer.rs b/lightningbeam-ui/lightningbeam-core/src/renderer.rs index 1c3d226..0bf5cbb 100644 --- a/lightningbeam-ui/lightningbeam-core/src/renderer.rs +++ b/lightningbeam-ui/lightningbeam-core/src/renderer.rs @@ -549,7 +549,7 @@ fn render_background(document: &Document, scene: &mut Scene, base_transform: Aff // Draw checkerboard behind transparent backgrounds (UI-only; skip in export) if draw_checkerboard && bg.a < 255 { - use vello::peniko::{Blob, Color, Extend, ImageAlphaType, ImageData, ImageQuality}; + use vello::peniko::{Blob, Extend, ImageAlphaType, ImageData, ImageQuality}; // 2x2 pixel checkerboard pattern: light/dark alternating let light: [u8; 4] = [204, 204, 204, 255]; let dark: [u8; 4] = [170, 170, 170, 255]; @@ -1091,7 +1091,7 @@ pub fn render_dcel( // Gradient fill (takes priority over solid colour fill) if !filled { if let Some(ref grad) = face.gradient_fill { - use kurbo::{Point, Rect}; + use kurbo::Rect; let bbox: Rect = vello::kurbo::Shape::bounding_box(&path); let (start, end) = gradient_bbox_endpoints(grad.angle, bbox); let brush = grad.to_peniko_brush(start, end, opacity_f32);