mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Memory Leaks w/ Container (#7750)
Gives instance initializers the ability to add a `teardown` method that will be called between tests to clean up after themselves.
This commit is contained in:
committed by
Joffrey JAFFEUX
parent
47095a7fa1
commit
3d7c26c15e
@@ -169,6 +169,15 @@ QUnit.testDone(function() {
|
||||
});
|
||||
});
|
||||
|
||||
Discourse._runInitializer("instanceInitializers", function(
|
||||
name,
|
||||
initializer
|
||||
) {
|
||||
if (initializer && initializer.teardown) {
|
||||
initializer.teardown();
|
||||
}
|
||||
});
|
||||
|
||||
// attempts to remove any subscribed message bus callback
|
||||
window.MessageBus.callbacks.forEach(function(callback) {
|
||||
window.MessageBus.unsubscribe(callback.channel, callback.func);
|
||||
|
||||
Reference in New Issue
Block a user