From 4adb65596a7dc4a4744fd14f8ce5c79b234842de Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Thu, 14 Jul 2016 10:41:02 -0400 Subject: [PATCH] Remove socket binding when the scope is destroyed so that we don't make errant GET requests in future instances of this controller. --- awx/ui/client/src/standard-out/standard-out.controller.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/awx/ui/client/src/standard-out/standard-out.controller.js b/awx/ui/client/src/standard-out/standard-out.controller.js index 805200201e..f43d6c4ea5 100644 --- a/awx/ui/client/src/standard-out/standard-out.controller.js +++ b/awx/ui/client/src/standard-out/standard-out.controller.js @@ -39,6 +39,12 @@ export function JobStdoutController ($rootScope, $scope, $state, $stateParams, } }); + // Unbind $rootScope socket event binding(s) so that they don't get triggered + // in another instance of this controller + $scope.$on('$destroy', function() { + $scope.removeJobStatusChange(); + }); + // Set the parse type so that CodeMirror knows how to display extra params YAML/JSON $scope.parseType = 'yaml';