Commit b94d54d0 authored by Seamus Lee's avatar Seamus Lee

Remove free calls from Activity and Member sections of CRM

parent bc116c0a
......@@ -2361,7 +2361,6 @@ AND cl.modified_id = c.id
$priorActivities[$index][$dao->activityID]['name'] = $dao->name;
$priorActivities[$index][$dao->activityID]['date'] = $dao->date;
}
$dao->free();
}
}
return $priorActivities[$index];
......@@ -2678,10 +2677,8 @@ AND cl.modified_id = c.id
$result = self::deleteActivity($activityParams);
}
$activityContactOther->free();
}
$activityContact->free();
$transaction->commit();
return $result;
......
......@@ -309,7 +309,6 @@ class CRM_Activity_Page_AJAX {
$mainActivity->save();
$mainActivityId = $mainActivity->id;
CRM_Activity_BAO_Activity::logActivityAction($mainActivity);
$mainActivity->free();
// Mark previous activity as deleted. If it was a non-case activity
// then just change the subject.
......@@ -330,9 +329,7 @@ class CRM_Activity_Page_AJAX {
}
$otherActivity->save();
$caseActivity->free();
}
$otherActivity->free();
$targetContacts = array();
if (!empty($params['targetContactIds'])) {
......@@ -385,7 +382,6 @@ class CRM_Activity_Page_AJAX {
$params['mainActivityId'] = $mainActivityId;
CRM_Activity_BAO_Activity::copyExtendedActivityData($params);
CRM_Utils_Hook::post('create', 'CaseActivity', $caseActivity->id, $caseActivity);
$caseActivity->free();
return (array('error_msg' => $error_msg, 'newId' => $mainActivity->id));
}
......
......@@ -94,7 +94,6 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership {
$membership->id = $id;
$membership->save();
$membership->free();
if (empty($membership->contact_id) || empty($membership->status_id)) {
// this means we are in renewal mode and are just updating the membership
......@@ -545,8 +544,6 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership {
$defaults['active'] = TRUE;
}
$membership->free();
return $membership;
}
......@@ -702,7 +699,6 @@ INNER JOIN civicrm_membership_type type ON ( type.id = membership.membership_ty
self::deleteRelatedMemberships($membership->id);
self::deleteMembership($membership->id);
}
$membership->free();
}
/**
......@@ -1184,7 +1180,6 @@ AND civicrm_membership.is_test = %2";
$memberDAO->end_date = CRM_Utils_Date::isoToMysql($memberDAO->end_date);
$memberDAO->save();
CRM_Core_DAO::storeValues($memberDAO, $currentMembership);
$memberDAO->free();
$currentMembership['is_current_member'] = CRM_Core_DAO::getFieldValue(
'CRM_Member_DAO_MembershipStatus',
......@@ -1277,10 +1272,8 @@ SELECT c.contribution_page_id as pageID
$relatedMembership->id = $membership->id;
$relatedMembership->copyValues($params);
$relatedMembership->save();
$relatedMembership->free();
}
$membership->free();
}
/**
......@@ -1407,7 +1400,6 @@ WHERE civicrm_membership.contact_id = civicrm_contact.id
$nestedRelMembership->id = $membership->owner_membership_id;
$nestedRelMembership->contact_id = $cid;
$nestedRelationship = $nestedRelMembership->find(TRUE);
$nestedRelMembership->free();
}
if (!$nestedRelationship) {
$relatedContacts[$cid] = $status;
......@@ -1610,7 +1602,6 @@ FROM civicrm_membership_type
$membershipTypeValues[$dao->id][$mtField] = $dao->$mtField;
}
}
$dao->free();
CRM_Utils_Hook::membershipTypeValues($form, $membershipTypeValues);
......@@ -2168,7 +2159,6 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND
]);
$count++;
}
$deceasedDAO->free();
return $count;
}
......@@ -2279,7 +2269,6 @@ WHERE civicrm_membership.is_test = 0
while ($dao1->fetch()) {
self::processOverriddenUntilDateMembership($dao1);
}
$dao1->free();
$query = $baseQuery . " AND civicrm_membership.is_override IS NULL
AND civicrm_membership.status_id NOT IN (%1, %2, %3, %4)
......@@ -2351,7 +2340,6 @@ WHERE civicrm_membership.is_test = 0
$updateCount++;
}
}
$dao2->free();
$result['is_error'] = 0;
$result['messages'] = ts('Processed %1 membership records. Updated %2 records.', array(
1 => $processCount,
......
......@@ -46,7 +46,6 @@ class CRM_Member_BAO_MembershipLog extends CRM_Member_DAO_MembershipLog {
$membershipLog = new CRM_Member_DAO_MembershipLog();
$membershipLog->copyValues($params);
$membershipLog->save();
$membershipLog->free();
return $membershipLog;
}
......
......@@ -212,7 +212,6 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus {
}
$membershipStatus->delete();
CRM_Member_PseudoConstant::flush('membershipStatus');
$membershipStatus->free();
}
/**
......@@ -361,8 +360,6 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus {
}
//end fetch
$membershipStatus->free();
//we bundle the arguments into an array as we can't pass 8 variables to the hook otherwise
// the membership array might contain the pre-altered settings so we don't want to merge this
$arguments = array(
......@@ -394,7 +391,6 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus {
while ($membershipStatus->fetch()) {
$statusIds[] = $membershipStatus->id;
}
$membershipStatus->free();
return $statusIds;
}
......
......@@ -281,7 +281,6 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
while ($membershipType->fetch()) {
$membershipTypes[$membershipType->id] = $membershipType->name;
}
$membershipType->free();
return $membershipTypes;
}
......@@ -300,7 +299,6 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
$membershipType->id = $membershipTypeId;
if ($membershipType->find(TRUE)) {
CRM_Core_DAO::storeValues($membershipType, $membershipTypeDetails);
$membershipType->free();
return $membershipTypeDetails;
}
else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment