]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
free some memory in createsim.php
authorEvan Prodromou <evan@status.net>
Tue, 5 Jan 2010 08:49:09 +0000 (22:49 -1000)
committerEvan Prodromou <evan@status.net>
Tue, 5 Jan 2010 08:49:09 +0000 (22:49 -1000)
scripts/createsim.php

index 1266a9700b674ca58f76551b5417eee55cac5667..882d744564dbb4c4398cf9741fe7d6eafc90d739 100644 (file)
@@ -41,9 +41,12 @@ require_once INSTALLDIR.'/scripts/commandline.inc';
 function newUser($i)
 {
     global $userprefix;
-    User::register(array('nickname' => sprintf('%s%d', $userprefix, $i),
-                         'password' => sprintf('password%d', $i),
-                         'fullname' => sprintf('Test User %d', $i)));
+    $user = User::register(array('nickname' => sprintf('%s%d', $userprefix, $i),
+                                 'password' => sprintf('password%d', $i),
+                                 'fullname' => sprintf('Test User %d', $i)));
+    if (!empty($user)) {
+        $user->free();
+    }
 }
 
 function newNotice($i, $tagmax)
@@ -73,6 +76,9 @@ function newNotice($i, $tagmax)
     }
 
     $notice = Notice::saveNew($user->id, $content, 'system');
+
+    $user->free();
+    $notice->free();
 }
 
 function newSub($i)
@@ -106,6 +112,9 @@ function newSub($i)
     }
 
     subs_subscribe_to($from, $to);
+
+    $from->free();
+    $to->free();
 }
 
 function main($usercount, $noticeavg, $subsavg, $tagmax)