fix memory leak on macOS (#9)
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
f15e5eee20
commit
b91e1b2092
3 changed files with 49 additions and 35 deletions
|
|
@ -15,8 +15,7 @@ extern "C" {
|
|||
/// Keep the same name with Windows.
|
||||
void FlutterRgbaRendererPluginOnRgba(void* texture_rgba_ptr, const uint8_t* buffer, int len, int width, int height, int stride_align) {
|
||||
TextRgba* texture_rgba = (__bridge TextRgba *)(texture_rgba_ptr);
|
||||
NSData* data = [NSData dataWithBytesNoCopy:(void*)buffer length:len freeWhenDone:FALSE];
|
||||
[texture_rgba markFrameAvaliableWithData:data width:width height:height stride_align: stride_align];
|
||||
[texture_rgba markFrameAvaliableRawWithBuffer:buffer len:len width:width height:height stride_align: stride_align];
|
||||
}
|
||||
|
||||
#if __cplusplus
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue