File tree 3 files changed +12
-7
lines changed
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)
74
74
result) { HandleMethodCall (call, std::move (result)); });
75
75
}
76
76
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 (); }
83
78
79
+ void PlatformViewChannel::Dispose () {
84
80
// Clean-up view_instances_
85
81
for (auto const & [viewId, viewInstance] : view_instances_) {
86
- viewInstance->Dispose ();
87
82
delete viewInstance;
88
83
}
89
84
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 ();
90
91
}
91
92
92
93
void 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 {
19
19
public:
20
20
explicit PlatformViewChannel (flutter::BinaryMessenger* messenger);
21
21
virtual ~PlatformViewChannel ();
22
+ void Dispose ();
22
23
std::map<std::string, std::unique_ptr<PlatformViewFactory>>& ViewFactories () {
23
24
return view_factories_;
24
25
}
Original file line number Diff line number Diff line change @@ -200,6 +200,9 @@ bool TizenEmbedderEngine::RunEngine(
200
200
201
201
bool TizenEmbedderEngine::StopEngine () {
202
202
if (flutter_engine) {
203
+ if (platform_view_channel) {
204
+ platform_view_channel->Dispose ();
205
+ }
203
206
if (plugin_registrar_destruction_callback_) {
204
207
plugin_registrar_destruction_callback_ (plugin_registrar_.get ());
205
208
}
You can’t perform that action at this time.
0 commit comments