diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b831619e5b1a6b7d6ede07f472a1fb4a744ab997..b4f7f8faf5f329debc41c575fef57494f867d944 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 e773657a9402bda3bd398e618c1a67bd04b051a8..d81faeff4edcadcc63f8888cc3ac7b6b9b26586b 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);