Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 94e80fc

Browse files
[url_launcher] Fix minor memory leak in Linux url-launcher tests (#4648)
1 parent 5899fe5 commit 94e80fc

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/url_launcher/url_launcher_linux/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## NEXT
22

33
* Updates code for new analysis options.
4+
* Fix minor memory leak in Linux url_launcher tests.
45

56
## 2.0.2
67

packages/url_launcher/url_launcher_linux/linux/test/url_launcher_linux_test.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ TEST(UrlLauncherPlugin, CanLaunchSuccess) {
1818
g_autoptr(FlValue) args = fl_value_new_map();
1919
fl_value_set_string_take(args, "url",
2020
fl_value_new_string("https://flutter.dev"));
21-
FlMethodResponse* response = can_launch(nullptr, args);
21+
g_autoptr(FlMethodResponse) response = can_launch(nullptr, args);
2222
ASSERT_NE(response, nullptr);
2323
ASSERT_TRUE(FL_IS_METHOD_SUCCESS_RESPONSE(response));
2424
g_autoptr(FlValue) expected = fl_value_new_bool(true);
@@ -30,7 +30,7 @@ TEST(UrlLauncherPlugin, CanLaunchSuccess) {
3030
TEST(UrlLauncherPlugin, CanLaunchFailureUnhandled) {
3131
g_autoptr(FlValue) args = fl_value_new_map();
3232
fl_value_set_string_take(args, "url", fl_value_new_string("madeup:scheme"));
33-
FlMethodResponse* response = can_launch(nullptr, args);
33+
g_autoptr(FlMethodResponse) response = can_launch(nullptr, args);
3434
ASSERT_NE(response, nullptr);
3535
ASSERT_TRUE(FL_IS_METHOD_SUCCESS_RESPONSE(response));
3636
g_autoptr(FlValue) expected = fl_value_new_bool(false);
@@ -44,7 +44,7 @@ TEST(UrlLauncherPlugin, CanLaunchFailureUnhandled) {
4444
TEST(UrlLauncherPlugin, CanLaunchFailureInvalidUrl) {
4545
g_autoptr(FlValue) args = fl_value_new_map();
4646
fl_value_set_string_take(args, "url", fl_value_new_string(""));
47-
FlMethodResponse* response = can_launch(nullptr, args);
47+
g_autoptr(FlMethodResponse) response = can_launch(nullptr, args);
4848
ASSERT_NE(response, nullptr);
4949
ASSERT_TRUE(FL_IS_METHOD_SUCCESS_RESPONSE(response));
5050
g_autoptr(FlValue) expected = fl_value_new_bool(false);

0 commit comments

Comments
 (0)