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

Unified Diff: pkg/unittest/lib/src/test_case.dart

Issue 495813002: Fix memory leak in unittest - the testCases variable doesn't release the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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 | « no previous file | pkg/unittest/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/src/test_case.dart
===================================================================
--- pkg/unittest/lib/src/test_case.dart (revision 39431)
+++ pkg/unittest/lib/src/test_case.dart (working copy)
@@ -15,13 +15,13 @@
final String description;
/// The setup function to call before the test, if any.
- final Function _setUp;
+ Function _setUp;
/// The teardown function to call after the test, if any.
- final Function _tearDown;
+ Function _tearDown;
/// The body of the test case.
- final TestFunction _testFunction;
+ TestFunction _testFunction;
/// Remaining number of callbacks functions that must reach a 'done' state
/// to wait for before the test completes.
@@ -120,7 +120,11 @@
} else if (_tearDown != null) {
return _tearDown();
}
- }).catchError(_errorHandler('Teardown'));
+ }).catchError(_errorHandler('Teardown')).whenComplete(() {
+ _setUp = null;
+ _tearDown = null;
+ _testFunction = null;
+ });
}
// Set the results, notify the config, and return true if this
« no previous file with comments | « no previous file | pkg/unittest/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698