We have been removing a few of these each release. They no longer provide any benefit
as the resources are released in the deconstructor. OTOH they can in rare circumstances cause bugs.
Previous removals have not caused any issues so the slow approach is starting to
look overly cautious now
// we need to set this on the form so that hooks can identify the created entity
$this->set('id', $bao->id);
- $bao->free();
$status = ts("Your new Reminder titled %1 has been saved.",
[1 => "<strong>{$values['title']}</strong>"]
while ($blockDAO->fetch()) {
$locBlockIds[$name][] = $blockDAO->id;
}
- $blockDAO->free();
}
return $locBlockIds;
}
}
CRM_Utils_Hook::post('delete', $type, $id, $obj);
- $obj->free();
return TRUE;
}
$ids['relationship'] = $relationship->id;
CRM_Contact_BAO_Relationship::setIsActive($relationship->id, TRUE);
}
- $relationship->free();
}
//need to handle related meberships. CRM-3792
CRM_Core_Action::DELETE
);
}
- $relationship->free();
}
}
}
$contactDetails[$contact->componentId][$property] = $contact->$property;
}
}
- $contact->free();
}
return $contactDetails;
$customDataCount = CRM_Core_DAO::singleValueQuery($sql);
if (!empty($customDataCount)) {
- $dao->free();
return TRUE;
}
}
];
}
}
- $dao->free();
$hierarchy = [];
for ($i = 0; $i < count($roots); $i++) {
CRM_Core_BAO_CustomValueTable::store($params['custom'], 'civicrm_relationship', $relationship->id);
}
- $relationship->free();
-
CRM_Utils_Hook::post($hook, 'Relationship', $relationship->id, $relationship);
return $relationship;
// Check whether the custom field values are identical.
$result = self::checkDuplicateCustomFields($params, $relationship->id);
if ($result) {
- $relationship->free();
return TRUE;
}
}
- $relationship->free();
return FALSE;
}
}
}
- $relationship->free();
return $values;
}
}
$relationshipType->copyValues($params);
if ($relationshipType->find(TRUE)) {
CRM_Core_DAO::storeValues($relationshipType, $defaults);
- $relationshipType->free();
return $relationshipType;
}
return NULL;
$ruleDao = new CRM_Dedupe_DAO_Rule();
$ruleDao->dedupe_rule_group_id = $rgDao->id;
$ruleDao->delete();
- $ruleDao->free();
-
$substrLenghts = [];
$tables = [];
$ruleDao->rule_length = $length;
$ruleDao->rule_weight = $weight;
$ruleDao->save();
- $ruleDao->free();
if (!array_key_exists($table, $tables)) {
$tables[$table] = [];
$this->_contactIds[] = $householdsDAO->household_id;
}
}
- $householdsDAO->free();
}
// If contact list has changed, households will probably be at the end of
$formatting['contact_sub_type'] = $relationType->$direction;
}
}
- $relationType->free();
$contactFields = NULL;
$contactFields = CRM_Contact_DAO_Contact::import();
$params[$key]['contact_sub_type'] = $relationshipType->$direction;
}
}
- $relationshipType->free();
}
self::isErrorInCustomData($params[$key], $errorMessage, $csType, $relationships);
$this->_premiumID = $dao->id;
$this->_productDAO = $dao;
}
- $dao->free();
}
/**
$contributionContactIds["{$result->contact_id}-{$result->contribution_id}"] = $result->contribution_id;
}
}
- $result->free();
$form->assign('totalSelectedContributions', $form->get('rowCount'));
}
// get prepared to search within already found dupes if $searchWithinDupes flag is set
$dao->query("DROP TEMPORARY TABLE IF EXISTS dedupe_copy");
$dao->query("CREATE TEMPORARY TABLE dedupe_copy SELECT * FROM {$this->temporaryTables['dedupe']} WHERE weight >= {$weightSum}");
- $dao->free();
preg_match($patternColumn, $query, $matches);
$query = str_replace(' WHERE ', str_replace('column', $matches[1], $dupeCopyJoin), $query);
// Make a second temp table:
$dao->query("DROP TEMPORARY TABLE IF EXISTS dedupe_copy_2");
$dao->query("CREATE TEMPORARY TABLE dedupe_copy_2 SELECT * FROM {$this->temporaryTables['dedupe']} WHERE weight >= {$weightSum}");
- $dao->free();
// After the union, use that new temp table:
$part1 = substr($query, 0, $matches[1][1]);
$query = $part1 . str_replace('dedupe_copy', 'dedupe_copy_2', substr($query, $matches[1][1]));
// FIXME: we need to be more acurate with affected rows, especially for insert vs duplicate insert.
// And that will help optimize further.
$affectedRows = $dao->affectedRows();
- $dao->free();
// In an inclusive situation, failure of any query means no further processing -
if ($affectedRows == 0) {
CRM_Core_BAO_File::deleteFileReferences($fileIds[$mainId], $mainId, $customId);
}
}
- $dao->free();
// move the other contact's file to main contact
//NYSS need to INSERT or UPDATE depending on whether main contact has an existing record
$tracker->save();
}
$id = $tracker->id;
- $tracker->free();
$redirect = $config->userFrameworkResourceURL . "extern/url.php?u=$id";
$urlCache[$mailing_id . $url] = $redirect;
if (!$q) {
return NULL;
}
- $q->free();
$delivered = new CRM_Mailing_Event_BAO_Delivered();
$delivered->time_stamp = date('YmdHis');
if ($dao->fetch()) {
$contact_id = $dao->contact_id;
}
- $dao->free();
}
$transaction = new CRM_Core_Transaction();
];
}
- $dao->free();
return $groups;
}
while ($dao->fetch()) {
$customFields[$dao->table_name . '_custom_' . $dao->id] = $dao->id;
}
- $dao->free();
$entryFound = FALSE;
foreach ($rows as $rowNum => $row) {
while ($dao->fetch()) {
$contactIds[] = $dao->cid;
}
- $dao->free();
$this->setPager();
$relationshipRows = [];
}
$rows[$dao->civicrm_contact_id]['aggregate_amount'] += $dao->civicrm_contribution_total_amount;
}
- $dao->free();
return $rows;
}
$relatedContactIds[$dao->contact_id_a] = $dao->contact_id_a;
}
}
- $dao->free();
return [$relationshipRows, $relatedContactIds];
}
// to save the field `group_name`, which is required in older schema.
\CRM_Core_DAO::executeQuery(\CRM_Utils_SQL_Insert::dao($dao)->toSQL());
}
- $dao->free();
}
}