mirror of https://github.com/calzoneman/sync.git
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.
This commit is contained in:
parent
324fa6c81a
commit
e973813718
|
@ -15,7 +15,6 @@ var Media = require("./media").Media;
|
||||||
var util = require("./utilities");
|
var util = require("./utilities");
|
||||||
var vimeoWorkaround = require("./get-info").vimeoWorkaround;
|
var vimeoWorkaround = require("./get-info").vimeoWorkaround;
|
||||||
var Config = require("./config");
|
var Config = require("./config");
|
||||||
var AllPlaylists = {};
|
|
||||||
|
|
||||||
function PlaylistItem(media, uid) {
|
function PlaylistItem(media, uid) {
|
||||||
this.media = media;
|
this.media = media;
|
||||||
|
@ -37,11 +36,6 @@ PlaylistItem.prototype.pack = function() {
|
||||||
|
|
||||||
function Playlist(chan) {
|
function Playlist(chan) {
|
||||||
var name = chan.uniqueName;
|
var name = chan.uniqueName;
|
||||||
if(name in AllPlaylists && AllPlaylists[name]) {
|
|
||||||
var pl = AllPlaylists[name];
|
|
||||||
if(!pl.dead)
|
|
||||||
pl.die();
|
|
||||||
}
|
|
||||||
this.items = new ULList();
|
this.items = new ULList();
|
||||||
this.current = null;
|
this.current = null;
|
||||||
this.next_uid = 0;
|
this.next_uid = 0;
|
||||||
|
@ -55,7 +49,6 @@ function Playlist(chan) {
|
||||||
"remove": [],
|
"remove": [],
|
||||||
};
|
};
|
||||||
this.fnqueue = new AsyncQueue();
|
this.fnqueue = new AsyncQueue();
|
||||||
AllPlaylists[name] = this;
|
|
||||||
|
|
||||||
this.channel = chan;
|
this.channel = chan;
|
||||||
this.server = chan.server;
|
this.server = chan.server;
|
||||||
|
|
|
@ -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.
|
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 singleton = null;
|
||||||
var Config = require("./config");
|
var Config = require("./config");
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"author": "Calvin Montgomery",
|
"author": "Calvin Montgomery",
|
||||||
"name": "CyTube",
|
"name": "CyTube",
|
||||||
"description": "Online media synchronizer and chat",
|
"description": "Online media synchronizer and chat",
|
||||||
"version": "3.0.1",
|
"version": "3.0.2",
|
||||||
"repository": {
|
"repository": {
|
||||||
"url": "http://github.com/calzoneman/sync"
|
"url": "http://github.com/calzoneman/sync"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue