diff --git a/src/Elm/Kernel/Platform.js b/src/Elm/Kernel/Platform.js index d3cf8db0..2e073436 100644 --- a/src/Elm/Kernel/Platform.js +++ b/src/Elm/Kernel/Platform.js @@ -51,7 +51,14 @@ function _Platform_initialize(flagDecoder, args, init, update, subscriptions, st _Platform_enqueueEffects(managers, initPair.b, subscriptions(model)); - return ports ? { ports: ports } : {}; + const shutdown = function() { + managers = null + model = null + stepper = null + ports = null + } + + return ports ? { ports: ports, shutdown: shutdown } : { shutdown: shutdown }; }