Skip to content
Snippets Groups Projects
Commit a5715b80 authored by dgrove@google.com's avatar dgrove@google.com
Browse files

Fix memory leak in unittest - the testCases variable doesn't release the

closure of each test after it runs.

R=rnystrom@google.com

Review URL: https://codereview.chromium.org//495813002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart/pkg/unittest@39438 260f80e4-7a28-3924-810f-c04153c831b5
parent db6c878d
No related branches found
No related tags found
No related merge requests found
......@@ -15,13 +15,13 @@ class TestCase {
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 @@ class TestCase {
} 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
......
name: unittest
version: 0.11.0+4
version: 0.11.0+5
author: Dart Team <misc@dartlang.org>
description: A library for writing dart unit tests.
homepage: https://pub.dartlang.org/packages/unittest
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment