for (unsigned int j = 0; j < (result_model_data_id)[i].dataId.size(); j++)
{
- CModelData *pModelData = new CModelData();
+ CModelData *pModelData = NULL;
IContextModel *pCM = NULL;
ModelPropertyVec modelPropertyVec;
SSM_CLEANUP_ASSERT(m_pPropagationEngine->getContextModel((result_model_data_id)[i].modelName,
&pCM));
SSM_CLEANUP_ASSERT(pCM->getModelData((result_model_data_id)[i].dataId[j], &modelPropertyVec));
+ pModelData = new CModelData();
pModelData->setDataId((result_model_data_id)[i].dataId[j]);
for (ModelPropertyVec::iterator itor = modelPropertyVec.begin();
itor != modelPropertyVec.end(); ++itor)
pData[0] = EVENT_TYPE_OUTER;
pData[1] = userTriggerId;
pData[2] = reinterpret_cast<intptr_t>(pDataReader);
+ pDataReader = NULL;
m_pTasker->addTask(this, (void *)pData);
CLEANUP:
m_mtxQueries.unlock();
+ SAFE_DELETE(pDataReader);
SAFE_RELEASE(temp_contextmodel);
SAFE_RELEASE(temp_contextmodel2);
return res;
pConditionedQuery->addRef();
m_conditionedQueries[m_cqid] = pConditionedQuery;
m_contextQueries[m_cqid] = clsContextQuery;
+ clsContextQuery = NULL; //Mark it NULL, so that it's not freed in CLEANUP.
m_mtxQueries.unlock();
if (pConditionedQuery->hasAllConditionedModels() == true)
CLEANUP:
SAFE_RELEASE(pConditionedQuery);
SAFE_RELEASE(pConditionedQueryResult);
+ SAFE_DELETE(clsContextQuery);
return res;
}