X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fsoft-sensor-manager%2FSSMCore%2Fsrc%2FQueryProcessor%2FQueryEngine.cpp;h=4392b8fb35a013e05471ef4acc413ca872f4c3aa;hb=8c01dff2c5bc5496f7dc1632c498943ec6ecb015;hp=7399891fb8143486539c6247c8360350b064f6b0;hpb=935fdb9b67b6c10d007e652e9e2e028fd6ccfe09;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/soft-sensor-manager/SSMCore/src/QueryProcessor/QueryEngine.cpp b/service/soft-sensor-manager/SSMCore/src/QueryProcessor/QueryEngine.cpp index 7399891..4392b8f 100644 --- a/service/soft-sensor-manager/SSMCore/src/QueryProcessor/QueryEngine.cpp +++ b/service/soft-sensor-manager/SSMCore/src/QueryProcessor/QueryEngine.cpp @@ -137,13 +137,14 @@ SSMRESULT CQueryEngine::processQueryResult(int userTriggerId, 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) @@ -162,6 +163,7 @@ SSMRESULT CQueryEngine::processQueryResult(int userTriggerId, pData[0] = EVENT_TYPE_OUTER; pData[1] = userTriggerId; pData[2] = reinterpret_cast(pDataReader); + pDataReader = NULL; m_pTasker->addTask(this, (void *)pData); @@ -169,6 +171,7 @@ SSMRESULT CQueryEngine::processQueryResult(int userTriggerId, CLEANUP: m_mtxQueries.unlock(); + SAFE_DELETE(pDataReader); SAFE_RELEASE(temp_contextmodel); SAFE_RELEASE(temp_contextmodel2); return res; @@ -318,6 +321,7 @@ SSMRESULT CQueryEngine::executeContextQuery(std::string contextQuery, int *cqid) 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) @@ -366,6 +370,7 @@ SSMRESULT CQueryEngine::executeContextQuery(std::string contextQuery, int *cqid) CLEANUP: SAFE_RELEASE(pConditionedQuery); SAFE_RELEASE(pConditionedQueryResult); + SAFE_DELETE(clsContextQuery); return res; }