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

@ -15,7 +15,7 @@ extern "C" {
/// Keep the same name with Windows.
void FlutterRgbaRendererPluginOnRgba(void* texture_rgba_ptr, const uint8_t* buffer, int width, int height) {
TextRgba* texture_rgba = (__bridge TextRgba *)(texture_rgba_ptr);
NSData* data = [NSData dataWithBytesNoCopy:(void*)buffer length:width * height * 4];
NSData* data = [NSData dataWithBytesNoCopy:(void*)buffer length:width * height * 4 freeWhenDone:FALSE];
[texture_rgba markFrameAvaliableWithData:data width:width height:height];
}