Regarding Deleteing pointer!!!!!
Hi Friends,
Can anyone tell me I am getting an error like this....
Code:
Passing '*this->m_ptr_ptr' as parameter after its value was freed. Object '*this->m_ptr_ptr' was used at line 184 after being freed by passing argument 1 to function 'delete' at line 173
Here is the code snippet for your reference...
Code:
int *m_ptr_ptr = new com::att::ib::Core_V1_0::NVPair
.......
.......
.......
void
com::att::ib::Core_V1_0::IT_Gen_NVPairStreamable::replace_nonshareable_arg(
CORBA::IT_InStream_ptr is,
unsigned long _direction
)
{
if (*m_ptr_ptr != 0)
{
if (m_own_value|| _direction == CORBA::ARG_OUT)
{
delete *m_ptr_ptr;
}
if (_direction != CORBA::ARG_INOUT)
{
*m_ptr_ptr = 0;
}
if (_direction == CORBA::ARG_IN)
{
m_own_value = IT_TRUE;
}
}
read(is);
}
Please give me the solutions..
Thanks in advance!!!!!