diff options
| author | Misko Hevery | 2012-05-09 19:10:05 -0400 |
|---|---|---|
| committer | Igor Minar | 2012-05-14 21:56:22 -0700 |
| commit | 24e7da4f1954dbe2e89f82950ed00292678534fd (patch) | |
| tree | 016a7355fbc57e19f73918680e0a7dffc73b57e5 /src/ngMock | |
| parent | 7b739c97028be2a5d5aef679ef1f8064cd10d386 (diff) | |
| download | angular.js-24e7da4f1954dbe2e89f82950ed00292678534fd.tar.bz2 | |
fix(angular-mocks): memory leak in jasmine's DI utils
When using inject/module helper methods in tests, these methods would
leave the injector laying around after the test. Since injector is
the application it can grow very large.
Diffstat (limited to 'src/ngMock')
| -rw-r--r-- | src/ngMock/angular-mocks.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ngMock/angular-mocks.js b/src/ngMock/angular-mocks.js index a2d4f88b..b0f6383a 100644 --- a/src/ngMock/angular-mocks.js +++ b/src/ngMock/angular-mocks.js @@ -1546,6 +1546,12 @@ window.jstestdriver && (function(window) { window.jasmine && (function(window) { + afterEach(function() { + var spec = getCurrentSpec(); + spec.$injector = null; + spec.$modules = null; + }); + function getCurrentSpec() { return jasmine.getEnv().currentSpec; } |
