Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewdeandrade/5f70eba155fce7eca372 to your computer and use it in GitHub Desktop.
Save andrewdeandrade/5f70eba155fce7eca372 to your computer and use it in GitHub Desktop.
0001-Added-deregisterContext-method-to-Engine.patch
From 63aae6759669ccafcf235dd0fdc17f2990cc5699 Mon Sep 17 00:00:00 2001
From: Andrew de Andrade <andrew@deandrade.com.br>
Date: Fri, 27 Jun 2014 13:16:01 -0700
Subject: [PATCH] Added deregisterContext method to Engine
---
Engine.js | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/Engine.js b/Engine.js
index 29cfb1c..243ae70 100644
--- a/Engine.js
+++ b/Engine.js
@@ -300,6 +300,19 @@ define(function(require, exports, module) {
};
/**
+ * Deregisters an existing context so that the engine ceases to update it
+ * within the run loop.
+ *
+ * @param {Context} context Context to deregister
+ */
+ Engine.deregisterContext = function deregisterContext(context) {
+ var i = contexts.indexOf(context);
+ if (i > -1) {
+ contexts.splice(i, 1);
+ }
+ };
+
+ /**
* Queue a function to be executed on the next tick of the
* Engine.
*
--
2.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment