File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
flutter/shell/platform/tizen/channels Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ AppControl::AppControl(app_control_h handle) : id_(next_id_++) {
6767}
6868
6969AppControl::~AppControl () {
70+ on_reply_ = nullptr ;
7071 if (handle_) {
7172 app_control_destroy (handle_);
7273 }
Original file line number Diff line number Diff line change 55#include " app_control_channel.h"
66
77#include < cstdint>
8+ #include < memory>
89#include < string>
910#include < variant>
1011#include < vector>
@@ -169,15 +170,14 @@ void AppControlChannel::SendLaunchRequest(
169170 std::unique_ptr<MethodResult<EncodableValue>> result) {
170171 EncodableValueHolder<bool > wait_for_reply (arguments, " waitForReply" );
171172 if (wait_for_reply && *wait_for_reply) {
172- auto * result_ptr = result.release ();
173- auto on_reply = [result_ptr](const EncodableValue& response) {
174- result_ptr->Success (response);
175- delete result_ptr;
173+ std::shared_ptr<MethodResult<EncodableValue>> result_box{std::move (result)};
174+ auto on_reply = [result_box](const EncodableValue& response) {
175+ result_box->Success (response);
176176 };
177+
177178 AppControlResult ret = app_control->SendLaunchRequestWithReply (on_reply);
178179 if (!ret) {
179- result_ptr->Error (ret.code (), ret.message ());
180- delete result_ptr;
180+ result_box->Error (ret.code (), ret.message ());
181181 }
182182 } else {
183183 AppControlResult ret = app_control->SendLaunchRequest ();
You can’t perform that action at this time.
0 commit comments