Skip to content

Commit

Permalink
Merge pull request #14990 from eileenmcnaughton/free
Browse files Browse the repository at this point in the history
Remove ?last? instances of ->free() dev/core#562
  • Loading branch information
colemanw authored Aug 8, 2019
2 parents 8f917a6 + fb53029 commit ee9f177
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 31 deletions.
4 changes: 0 additions & 4 deletions CRM/Core/DAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,26 +234,22 @@ protected function assignTestFK($fieldName, $fieldDef, $params) {
if ($fkDAO->find(TRUE)) {
$this->$dbName = $fkDAO->id;
}
$fkDAO->free();
}

elseif (in_array($FKClassName, CRM_Core_DAO::$_testEntitiesToSkip)) {
$depObject = new $FKClassName();
$depObject->find(TRUE);
$this->$dbName = $depObject->id;
$depObject->free();
}
elseif ($daoName == 'CRM_Member_DAO_MembershipType' && $fieldName == 'member_of_contact_id') {
// FIXME: the fields() metadata is not specific enough
$depObject = CRM_Core_DAO::createTestObject($FKClassName, ['contact_type' => 'Organization']);
$this->$dbName = $depObject->id;
$depObject->free();
}
else {
//if it is required we need to generate the dependency object first
$depObject = CRM_Core_DAO::createTestObject($FKClassName, CRM_Utils_Array::value($dbName, $params, 1));
$this->$dbName = $depObject->id;
$depObject->free();
}
}

Expand Down
3 changes: 0 additions & 3 deletions CRM/Utils/System/Backdrop.php
Original file line number Diff line number Diff line change
Expand Up @@ -880,9 +880,6 @@ public function synchronizeUsers() {
else {
$contactMatching++;
}
if (is_object($match)) {
$match->free();
}
}

return [
Expand Down
3 changes: 0 additions & 3 deletions CRM/Utils/System/Drupal.php
Original file line number Diff line number Diff line change
Expand Up @@ -836,9 +836,6 @@ public function synchronizeUsers() {
else {
$contactMatching++;
}
if (is_object($match)) {
$match->free();
}
}

return [
Expand Down
3 changes: 0 additions & 3 deletions CRM/Utils/System/Drupal6.php
Original file line number Diff line number Diff line change
Expand Up @@ -815,9 +815,6 @@ public function synchronizeUsers() {
else {
$contactMatching++;
}
if (is_object($match)) {
$match->free();
}
}

return [
Expand Down
3 changes: 0 additions & 3 deletions CRM/Utils/System/Drupal8.php
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,6 @@ public function synchronizeUsers() {
else {
$contactMatching++;
}
if (is_object($match)) {
$match->free();
}
}

return [
Expand Down
3 changes: 0 additions & 3 deletions CRM/Utils/System/Joomla.php
Original file line number Diff line number Diff line change
Expand Up @@ -897,9 +897,6 @@ public function synchronizeUsers() {
else {
$contactMatching++;
}
if (is_object($match)) {
$match->free();
}
}

return [
Expand Down
3 changes: 0 additions & 3 deletions CRM/Utils/System/WordPress.php
Original file line number Diff line number Diff line change
Expand Up @@ -847,9 +847,6 @@ public function synchronizeUsers() {
else {
$contactMatching++;
}
if (is_object($match)) {
$match->free();
}
}

return [
Expand Down
9 changes: 0 additions & 9 deletions tools/scripts/solr/createSyncJSON.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ function getTableInfo(&$contactIDs, &$values, $tableName, &$fields,
}
appendValue($values, $dao->contact_id, 'contact', $contact, $flat);
}
$dao->free();
}

/**
Expand Down Expand Up @@ -187,7 +186,6 @@ function getNoteInfo(&$contactIDs, &$values) {

appendValue($values, $dao->id, 'note', $note);
}
$dao->free();
}

/**
Expand Down Expand Up @@ -225,7 +223,6 @@ function getPhoneInfo(&$contactIDs, &$values) {

appendValue($values, $dao->id, 'phone', $phone);
}
$dao->free();
}

/**
Expand Down Expand Up @@ -258,7 +255,6 @@ function getEmailInfo(&$contactIDs, &$values) {
];
appendValue($values, $dao->id, 'email', $email);
}
$dao->free();
}

/**
Expand Down Expand Up @@ -309,7 +305,6 @@ function getAddressInfo(&$contactIDs, &$values) {
}
appendValue($values, $dao->id, 'address', $address);
}
$dao->free();
}

/**
Expand Down Expand Up @@ -362,7 +357,6 @@ function getRelationshipInfo(&$contactIDs, &$values, &$allContactIDs, &$addition
$allContactIDs, $additionalContacts
);
}
$dao->free();
}

/**
Expand Down Expand Up @@ -418,7 +412,6 @@ function getActivityInfo(&$contactIDs, &$values, &$allContactIDs, &$additionalCo
$allContactIDs, $additionalContacts
);
}
$dao->free();

if (empty($activityIDs)) {
return;
Expand All @@ -439,7 +432,6 @@ function getActivityInfo(&$contactIDs, &$values, &$allContactIDs, &$additionalCo
appendValue($values, $aaDAO->id, 'activity_assignment', $activityAssignee);
$activityContacts[] = $aaDAO->assignee_contact_id;
}
$aaDAO->free();

$sql = "SELECT * FROM civicrm_activity_target WHERE activity_id IN ($activityIDString)";
$atDAO = &CRM_Core_DAO::executeQuery($sql);
Expand All @@ -452,7 +444,6 @@ function getActivityInfo(&$contactIDs, &$values, &$allContactIDs, &$additionalCo
appendValue($values, $atDAO->id, 'activity_target', $activityTarget);
$activityContacts[] = $atDAO->target_contact_id;
}
$atDAO->free();

addAdditionalContacts($activityContacts, $allContactIDs, $additionalContacts);
}
Expand Down

0 comments on commit ee9f177

Please sign in to comment.