summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/jabber.php9
-rw-r--r--lib/omb.php6
-rw-r--r--lib/queuehandler.php6
3 files changed, 21 insertions, 0 deletions
diff --git a/lib/jabber.php b/lib/jabber.php
index a9643f4a6..bd7d6b707 100644
--- a/lib/jabber.php
+++ b/lib/jabber.php
@@ -92,6 +92,7 @@ function jabber_send_notice($to, $notice) {
$msg = jabber_format_notice($profile, $notice);
$entry = jabber_format_entry($profile, $notice);
$conn->message($to, $msg, 'chat', NULL, $entry);
+ $profile->free();
return true;
}
@@ -204,6 +205,9 @@ function jabber_broadcast_notice($notice) {
$msg = jabber_format_notice($profile, $notice);
$entry = jabber_format_entry($profile, $notice);
+ $profile->free();
+ unset($profile);
+
$sent_to = array();
$conn = jabber_connect();
@@ -225,6 +229,8 @@ function jabber_broadcast_notice($notice) {
$sent_to[$user->id] = 1;
}
+ $user->free();
+
# Now, get users subscribed to this profile
$user = new User();
@@ -245,6 +251,8 @@ function jabber_broadcast_notice($notice) {
}
}
+ $user->free();
+
return true;
}
@@ -280,6 +288,7 @@ function jabber_public_notice($notice) {
$conn->message($address, $msg, 'chat', NULL, $entry);
$conn->processTime(0);
}
+ $profile->free();
}
return true;
diff --git a/lib/omb.php b/lib/omb.php
index b1e8ab181..d4f53c332 100644
--- a/lib/omb.php
+++ b/lib/omb.php
@@ -132,6 +132,9 @@ function omb_broadcast_remote_subscribers($notice) {
}
}
+ $rp->free();
+ unset($rp);
+
return true;
}
@@ -160,6 +163,9 @@ function omb_post_notice_keys($notice, $postnoticeurl, $tk, $secret) {
$notice->id)));
$req->set_parameter('omb_notice_license', common_config('license', 'url'));
+ $user->free();
+ unset($user);
+
$req->sign_request(omb_hmac_sha1(), $con, $token);
# We re-use this tool's fetcher, since it's pretty good
diff --git a/lib/queuehandler.php b/lib/queuehandler.php
index d673f7f94..237df9a7b 100644
--- a/lib/queuehandler.php
+++ b/lib/queuehandler.php
@@ -87,11 +87,15 @@ class QueueHandler extends Daemon {
continue;
}
$this->log(LOG_INFO, 'finished broadcasting notice ID = ' . $notice->id);
+ $notice->free();
+ unset($notice);
$notice = NULL;
} else {
$this->log(LOG_WARNING, 'queue item for notice that does not exist');
}
$qi->delete();
+ $qi->free();
+ unset($qi);
$this->idle(0);
} else {
$this->clear_old_claims();
@@ -115,6 +119,8 @@ class QueueHandler extends Daemon {
$qi->transport = $this->transport();
$qi->whereAdd('now() - claimed > '.CLAIM_TIMEOUT);
$qi->update(DB_DATAOBJECT_WHEREADD_ONLY);
+ $qi->free();
+ unset($qi);
}
function log($level, $msg) {