summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYves Chedemois2010-12-03 16:27:26 (GMT)
committer Yves Chedemois2010-12-03 16:27:26 (GMT)
commitc0d2f432d19940be3bea12b5c0e3d1b04502cc22 (patch)
tree234db09c7be9a7434b88e21fc757672123457694
parent29d45358f93edb2ae53fc56c4147ba10ff183855 (diff)
#736440 by yched, dhthwy: fix memory leaks on long running migration scripts (e.g. migrate.module)
-rw-r--r--CHANGELOG.txt1
-rw-r--r--includes/content.token.inc5
2 files changed, 5 insertions, 1 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index b831619..b4f7f8f 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -5,6 +5,7 @@ CCK 6.x-2.x
- #863226 by KarenS: make sure we have a function that will return inactive instances when other instances of the same field are still active.
- #887742 by yched: fix notices in _content_get_formatter() in some Views
+- #736440 by yched, dhthwy: fix memory leaks on long running migration scripts (e.g. migrate.module)
CCK 6.x-2.8
===========
diff --git a/includes/content.token.inc b/includes/content.token.inc
index e773657..d81faef 100644
--- a/includes/content.token.inc
+++ b/includes/content.token.inc
@@ -24,7 +24,10 @@ function token_content_build_modes() {
function content_token_values($type, $object = NULL) {
$tokens = array();
if ($type == 'node') {
- $node = $object;
+ // Let PHP free the $node object when we are done. Working directly on the
+ // incoming $object causes memory leak issues on long-running scripts such
+ // as migrations. See http://drupal.org/node/736440.
+ $node = clone $object;
// Prevent against invalid 'nodes' built by broken 3rd party code.
if (isset($node->type)) {
$type = content_types($node->type);