Merge pull request #14247 from pradpnayak/ActvityTags
[civicrm-core.git] / Civi / API / SelectQuery.php
index 9a03d7eb39be703aecc75bb4ea9afcedb7be5a24..752159b3d7aa1213e723fd4fc64e1c85da8ca48b 100644 (file)
@@ -25,6 +25,7 @@
  +--------------------------------------------------------------------+
  */
 namespace Civi\API;
+
 use Civi\API\Exception\UnauthorizedException;
 
 /**
@@ -104,7 +105,6 @@ abstract class SelectQuery {
     $this->apiFieldSpec = $this->getFields();
 
     $this->query = \CRM_Utils_SQL_Select::from($bao->tableName() . ' ' . self::MAIN_TABLE_ALIAS);
-    $bao->free();
 
     // Add ACLs first to avoid redundant subclauses
     $this->checkPermissions = $checkPermissions;
@@ -144,7 +144,6 @@ abstract class SelectQuery {
 
     while ($result_dao->fetch()) {
       if (in_array('count_rows', $this->select)) {
-        $result_dao->free();
         return (int) $result_dao->c;
       }
       $result_entities[$result_dao->id] = [];
@@ -165,7 +164,6 @@ abstract class SelectQuery {
         }
       };
     }
-    $result_dao->free();
     return $result_entities;
   }