diff --git a/src/wayland_display.cc b/src/wayland_display.cc index efef2fc..515e2e4 100644 --- a/src/wayland_display.cc +++ b/src/wayland_display.cc @@ -618,7 +618,7 @@ bool WaylandDisplay::SetupEngine(const std::string &bundle_path, const std::vect .command_line_argc = static_cast(command_line_args_c.size()), .command_line_argv = command_line_args_c.data(), .platform_message_callback = [](const FlutterPlatformMessage *message, void *data) -> void { - if (std::string(message->channel) == "flutter/platform" && std::string((char *)message->message).find("\"method\":\"freeMemory\"") != std::string::npos) { + if (std::string(message->channel) == "flutter/platform" && std::string((char *)message->message, message->message_size).find("\"method\":\"freeMemory\"") != std::string::npos) { WaylandDisplay *const wd = get_wayland_display(data); if (wd->engine_) { auto ret = FlutterEngineNotifyLowMemoryWarning(wd->engine_);