r = reg.GetSectionListN(&pSections);
SysTryReturnResult(NID_APP, !IsFailed(r), r, "failed to GetSectionListN.");
- SysTryReturnResult(NID_APP, pSections != null, r, "Condition plugin info does not exist.");
+ SysTryReturnResult(NID_APP, pSections != null, r, "Condition plugin info does not exist.");
std::unique_ptr<IEnumerator> pEnum(pSections->GetEnumeratorN());
SysTryCatch(NID_APP, pEnum != null, , E_FAILURE, "failed to GetEnumeratorN.");
r = _ConditionDatabaseHelper::GetAllSectionsFromConditionDb(pSections.get());
SysTryReturnResult(NID_APP, !IsFailed(r), r, "failed to GetAllSectionsFromConditionDb.");
- SysTryReturnResult(NID_APP, pSections != null, r, "App Launch conditions does not exist.");
+ SysTryReturnResult(NID_APP, pSections != null, r, "App Launch conditions does not exist.");
std::unique_ptr< IEnumerator > pEnum(pSections->GetEnumeratorN());
SysTryReturnResult(NID_APP, pEnum != null, r, "failed to GetEnumeratorN.");
const String& condition, const IList* pArgs)
{
_DatabaseImpl condDb;
+ DbEnumerator* pEnum = null;
void* pBundleBuf = null;
int length = 0;
String statement;
SysTryReturnResult(NID_APP, !IsFailed(r), r, "failed to ConvertArgToBundleN.");
r = pStmt->BindInt(DB_TABLE_COND_ARG_COUNT, pArgs->GetCount());
- SysTryReturnResult(NID_APP, !IsFailed(r), r, "failed to bind argcount to database.");
+ SysTryCatch(NID_APP, !IsFailed(r), , r, "failed to bind argcount to database.");
r = pStmt->BindInt(DB_TABLE_COND_ARG_LENGTH, length);
- SysTryReturnResult(NID_APP, !IsFailed(r), r, "failed to bind length to database.");
+ SysTryCatch(NID_APP, !IsFailed(r), , r, "failed to bind length to database.");
r = pStmt->BindBlob(DB_TABLE_COND_ARG, pBundleBuf, length);
- SysTryReturnResult(NID_APP, !IsFailed(r), r, "failed to bind pBundleBuf to database.");
+ SysTryCatch(NID_APP, !IsFailed(r), , r, "failed to bind pBundleBuf to database.");
}
- std::unique_ptr<DbEnumerator> pEnum(condDb.ExecuteStatementN(*pStmt));
- SysTryReturnResult(NID_APP, pEnum == null, r, "pEnum should be null as INSERT operation took place.");
+ pEnum = condDb.ExecuteStatementN(*pStmt);
+ SysTryCatch(NID_APP, pEnum == null, , r, "pEnum should be null as INSERT operation took place.");
r = condDb.CommitTransaction();
- SysTryReturnResult(NID_APP, !IsFailed(r), r, "failed to commit database transaction.");
+ SysTryCatch(NID_APP, !IsFailed(r), , r, "failed to commit database transaction.");
- bundle_free_encoded_rawdata((bundle_raw**)&pBundleBuf);
+ if(pBundleBuf != null)
+ {
+ bundle_free_encoded_rawdata((bundle_raw**)&pBundleBuf);
+ }
return E_SUCCESS;
+
+CATCH:
+ SysLog(NID_APP, "Catch.");
+ if(pBundleBuf != null)
+ {
+ bundle_free_encoded_rawdata((bundle_raw**)&pBundleBuf);
+ return r;
+ }
}
result
char* pValue = _StringConverter::CopyToCharArrayN(*pStr);
bunRet = bundle_add(pBundle, pKey, pValue);
- delete pKey;
- delete pValue;
+ delete[] pKey;
+ delete[] pValue;
}
bunRet = bundle_encode_raw(pBundle, &pBundleRaw, &length);
{
pArgs->Add(*(new (std::nothrow) String(pValue)));
}
- delete pKey;
+ delete[] pKey;
}
free(pBundleBuf);