File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -74,19 +74,20 @@ PlatformViewChannel::PlatformViewChannel(flutter::BinaryMessenger* messenger)
7474 result) { HandleMethodCall (call, std::move (result)); });
7575}
7676
77- PlatformViewChannel::~PlatformViewChannel () {
78- // Clean-up view_factories_
79- for (auto const & [viewType, viewFactory] : view_factories_) {
80- viewFactory->Dispose ();
81- }
82- view_factories_.clear ();
77+ PlatformViewChannel::~PlatformViewChannel () { Dispose (); }
8378
79+ void PlatformViewChannel::Dispose () {
8480 // Clean-up view_instances_
8581 for (auto const & [viewId, viewInstance] : view_instances_) {
86- viewInstance->Dispose ();
8782 delete viewInstance;
8883 }
8984 view_instances_.clear ();
85+
86+ // Clean-up view_factories_
87+ for (auto const & [viewType, viewFactory] : view_factories_) {
88+ viewFactory->Dispose ();
89+ }
90+ view_factories_.clear ();
9091}
9192
9293void PlatformViewChannel::SendKeyEvent (Ecore_Event_Key* key, bool is_down) {
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ class PlatformViewChannel {
1919 public:
2020 explicit PlatformViewChannel (flutter::BinaryMessenger* messenger);
2121 virtual ~PlatformViewChannel ();
22+ void Dispose ();
2223 std::map<std::string, std::unique_ptr<PlatformViewFactory>>& ViewFactories () {
2324 return view_factories_;
2425 }
Original file line number Diff line number Diff line change @@ -200,6 +200,9 @@ bool TizenEmbedderEngine::RunEngine(
200200
201201bool TizenEmbedderEngine::StopEngine () {
202202 if (flutter_engine) {
203+ if (platform_view_channel) {
204+ platform_view_channel->Dispose ();
205+ }
203206 if (plugin_registrar_destruction_callback_) {
204207 plugin_registrar_destruction_callback_ (plugin_registrar_.get ());
205208 }
You can’t perform that action at this time.
0 commit comments