Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions shell/platform/tizen/channels/platform_view_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,20 @@ PlatformViewChannel::PlatformViewChannel(flutter::BinaryMessenger* messenger)
result) { HandleMethodCall(call, std::move(result)); });
}

PlatformViewChannel::~PlatformViewChannel() {
// Clean-up view_factories_
for (auto const& [viewType, viewFactory] : view_factories_) {
viewFactory->Dispose();
}
view_factories_.clear();
PlatformViewChannel::~PlatformViewChannel() { Dispose(); }

void PlatformViewChannel::Dispose() {
// Clean-up view_instances_
for (auto const& [viewId, viewInstance] : view_instances_) {
viewInstance->Dispose();
delete viewInstance;
}
view_instances_.clear();

// Clean-up view_factories_
for (auto const& [viewType, viewFactory] : view_factories_) {
viewFactory->Dispose();
}
view_factories_.clear();
}

void PlatformViewChannel::SendKeyEvent(Ecore_Event_Key* key, bool is_down) {
Expand Down
1 change: 1 addition & 0 deletions shell/platform/tizen/channels/platform_view_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class PlatformViewChannel {
public:
explicit PlatformViewChannel(flutter::BinaryMessenger* messenger);
virtual ~PlatformViewChannel();
void Dispose();
std::map<std::string, std::unique_ptr<PlatformViewFactory>>& ViewFactories() {
return view_factories_;
}
Expand Down
3 changes: 3 additions & 0 deletions shell/platform/tizen/tizen_embedder_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ bool TizenEmbedderEngine::RunEngine(

bool TizenEmbedderEngine::StopEngine() {
if (flutter_engine) {
if (platform_view_channel) {
platform_view_channel->Dispose();
}
if (plugin_registrar_destruction_callback_) {
plugin_registrar_destruction_callback_(plugin_registrar_.get());
}
Expand Down