Permalink
Browse files

[fix] Remove .free, it's removed

[fix] Don't crash on undefined page references
  • Loading branch information...
1 parent bc0921c commit 1ceb0bd31188bb78da6bad552d3c40edc373bcbd @3rd-Eden 3rd-Eden committed Jun 20, 2014
Showing with 0 additions and 5 deletions.
  1. +0 −5 primus.js
View
@@ -30,14 +30,11 @@ module.exports = function connection(spark) {
// to that page so we can get the correct pagelet instances.
//
case 'page':
- if (page && page.free) page.free();
-
//
// As part of setting a new Page instance, we need to release the
// previously added pagelet
//
Object.keys(pagelets).forEach(function free(name) {
- if (pagelets[name].free) pagelets[name].free();
delete pagelets[name];
});
@@ -90,11 +87,9 @@ module.exports = function connection(spark) {
spark.once('end', function end() {
debug('closed connection');
- if (page.free) page.free();
spark.page = page = null;
Object.keys(pagelets).forEach(function free(name) {
- if (pagelets[name].free) pagelets[name].free();
delete pagelets[name];
});
});

0 comments on commit 1ceb0bd

Please sign in to comment.