Skip to content

memory leak in proxy_on_platform_messsage. #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
james-lawrence opened this issue Sep 13, 2018 · 1 comment
Closed

memory leak in proxy_on_platform_messsage. #11

james-lawrence opened this issue Sep 13, 2018 · 1 comment
Labels
bug Something isn't working embedder Issue concerns the embedder package engine Depends on support form the Flutter Engine

Comments

@james-lawrence
Copy link
Contributor

james-lawrence commented Sep 13, 2018

see documentation

func proxy_on_platform_message(message *C.FlutterPlatformMessage, userPointer unsafe.Pointer) C.bool {
	if message.message != nil {
		str := C.GoString(C.converter(message.message, message.message_size))

		FlutterPlatformMessage := PlatformMessage{}

		messageContent := Message{}
		json.Unmarshal([]byte(str), &messageContent)

		FlutterPlatformMessage.Message = messageContent
		FlutterPlatformMessage.Channel = C.GoString(message.channel)
		if message.response_handle == nil {
			fmt.Println("==================== NIL")
		}

		return C.bool(globalFlutterOpenGL.FPlatfromMessage(FlutterPlatformMessage, userPointer))
	}
	return C.bool(false)

}
if message.response_handle == nil

should be

FlutterPlatformMessage.ResponseHandle = (*platformMessageResponseHandle)(message.response_handle)

we would still need to handle the response later on but this moves the needle in the right direction.

@pchampio pchampio added embedder Issue concerns the embedder package engine Depends on support form the Flutter Engine bug Something isn't working labels Sep 24, 2018
@pchampio
Copy link
Member

For the keyboard input we have to ignore this field.
The Doc says:

This field is ignored for messages being sent from the embedder to the framework

And since we are using FlutterEngineSendPlatformMessage (Can send multiple messages) and not FlutterEngineSendPlatformMessageResponse(Can send ONE message for One response), this is not a memory leak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working embedder Issue concerns the embedder package engine Depends on support form the Flutter Engine
Development

No branches or pull requests

2 participants