TITLE: CIMOMHandleQueryContext object is leaking.
DESCRIPTION: CMPI_SelectExp now maintaines its own QueryHandle.it clones it in the costructor and releases it in the destructor.
selxTab.lookup(i.key(), selx);
if (selx->eSelx)
delete selx->eSelx;
- if (selx->qContext)
- delete selx->qContext;
delete selx;
//Same as above!
//selxTab.remove(i.key());
request->operationContext.get(
SubscriptionFilterConditionContainer::NAME);
- CIMOMHandleQueryContext *_context=
- new CIMOMHandleQueryContext(
+ CIMOMHandleQueryContext _context(
CIMNamespaceName(
request->nameSpace.getString()),
*pr.getCIMOMHandle());
CMPI_SelectExp *eSelx=new CMPI_SelectExp(
request->operationContext,
- _context,
+ &_context,
request->query,
sub_cntr.getQueryLanguage());
srec->eSelx=eSelx;
- srec->qContext=_context;
CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
String lang(sub_cntr.getQueryLanguage());
CString className = _getClassNameFromQuery(
- _context,
+ &_context,
request->query,
lang).getCString();
if (--srec->count<=0)
{
selxTab.remove(sPath);
- delete _context;
delete eSelx;
delete srec;
}
};
CMPI_SelectExp *eSelx=srec->eSelx;
- CIMOMHandleQueryContext *qContext=srec->qContext;
CString className = eSelx->classNames[0].getClassName().
getString().getCString();
if (srec->count<=0)
{
- delete qContext;
delete eSelx;
delete srec;
}
{
}
CMPI_SelectExp *eSelx;
- CIMOMHandleQueryContext *qContext;
int count;
};
CMSetStatus (st, CMPI_RC_OK);
}
CMPI_SelectExp* cmpiSelectExp = new CMPI_SelectExp(
- selectStatement, false, qcontext.clone());
+ selectStatement, false, (QueryContext*) &qcontext);
PEG_METHOD_EXIT();
return (cmpiSelectExp);
}
delete cql_dnf;
delete cql_stmt;
#endif
+ delete _context;
}
CMPI_SelectExp::CMPI_SelectExp (
const OperationContext & ct,
QueryContext * context,
String cond_,
String lang_):ctx (ct),cond (cond_),lang (lang_),
- _context (context),persistent(true)
+ _context (context->clone()),persistent(true)
{
/**
We do NOT add ourselves to the CMPI_Object as this is a persitent object.
#ifdef PEGASUS_ENABLE_CQL
CMPI_SelectExp::CMPI_SelectExp (CQLSelectStatement * st, Boolean persistent_,
QueryContext *context):ctx (OperationContext ()),cql_stmt (st),
- _context(context), persistent (persistent_)
+ _context(context->clone()), persistent (persistent_)
{
/** Adding the object to the garbage collector.
*/