Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1210)

Unified Diff: runtime/bin/file_test.cc

Issue 1892623002: Fixes leak of native File objects. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/file_patch.dart ('k') | runtime/bin/file_unsupported.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_test.cc
diff --git a/runtime/bin/file_test.cc b/runtime/bin/file_test.cc
index 518e6e5c16da73d9d774f214b761191f6b78b7c9..4c2c0d169fe229de1ab070a0c8f616488cb8ee77 100644
--- a/runtime/bin/file_test.cc
+++ b/runtime/bin/file_test.cc
@@ -32,7 +32,7 @@ TEST_CASE(Read) {
buffer[13] = '\0';
EXPECT_STREQ("// Copyright ", buffer);
EXPECT(!file->WriteByte(1)); // Cannot write to a read-only file.
- delete file;
+ file->Release();
}
@@ -42,7 +42,7 @@ TEST_CASE(FileLength) {
File* file = File::Open(kFilename, File::kRead);
EXPECT(file != NULL);
EXPECT_EQ(42, file->Length());
- delete file;
+ file->Release();
}
@@ -56,7 +56,7 @@ TEST_CASE(FilePosition) {
EXPECT_EQ(12, file->Position());
EXPECT(file->ReadFully(buf, 6));
EXPECT_EQ(18, file->Position());
- delete file;
+ file->Release();
}
} // namespace bin
« no previous file with comments | « runtime/bin/file_patch.dart ('k') | runtime/bin/file_unsupported.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698