fix: macos ptr access

This commit is contained in:
Kingtous 2023-02-19 23:22:40 -08:00
parent 6fd900c479
commit 4f059a9138
6 changed files with 72 additions and 56 deletions

View file

@ -62,10 +62,8 @@ public class TextureRgbaRendererPlugin: NSObject, FlutterPlugin {
if (textureRgba == nil) {
result(0)
} else {
let ptr = withUnsafePointer(to: textureRgba!) { p in
return UnsafeRawPointer(p);
};
let intAddr = UInt(bitPattern: ptr)
let unmanaged = Unmanaged.passUnretained(textureRgba!)
let intAddr = UInt(bitPattern: unmanaged.toOpaque())
result(intAddr)
}
default: