From e9738137182fea844b84b372396af726517c3e43 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Thu, 10 Apr 2014 16:10:55 -0500 Subject: [PATCH] Patch a memory leak caused by an earlier failsafe A global object AllPlaylists was added back in v2 as a hardfix for an issue where playlists would continue to send updates after the channel was reloaded and the playlist object was obsolete. This condition should no longer happen due to other fixes, so the only thing this object was doing was wasting memory. --- lib/playlist.js | 7 ------- lib/server.js | 2 +- package.json | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/playlist.js b/lib/playlist.js index 00dca435..65c2865d 100644 --- a/lib/playlist.js +++ b/lib/playlist.js @@ -15,7 +15,6 @@ var Media = require("./media").Media; var util = require("./utilities"); var vimeoWorkaround = require("./get-info").vimeoWorkaround; var Config = require("./config"); -var AllPlaylists = {}; function PlaylistItem(media, uid) { this.media = media; @@ -37,11 +36,6 @@ PlaylistItem.prototype.pack = function() { function Playlist(chan) { var name = chan.uniqueName; - if(name in AllPlaylists && AllPlaylists[name]) { - var pl = AllPlaylists[name]; - if(!pl.dead) - pl.die(); - } this.items = new ULList(); this.current = null; this.next_uid = 0; @@ -55,7 +49,6 @@ function Playlist(chan) { "remove": [], }; this.fnqueue = new AsyncQueue(); - AllPlaylists[name] = this; this.channel = chan; this.server = chan.server; diff --git a/lib/server.js b/lib/server.js index 3b9868a1..f3fbe3ec 100644 --- a/lib/server.js +++ b/lib/server.js @@ -9,7 +9,7 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -const VERSION = "3.0.1"; +const VERSION = "3.0.2"; var singleton = null; var Config = require("./config"); diff --git a/package.json b/package.json index 51b2d407..b28443d2 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Calvin Montgomery", "name": "CyTube", "description": "Online media synchronizer and chat", - "version": "3.0.1", + "version": "3.0.2", "repository": { "url": "http://github.com/calzoneman/sync" },