The problem most likely resides in the DEV_INFO copy constructor and destructor, as well in the copy constructors and destructor of its members.
Check also the default constructor of DEV_INFO.
On way to reproduce your problem may be this one
class AClass
{
};
struct DEV_INFO
{
AClass *p;
DEV_INFO() {}
~DEV_INFO() { delete p; }
DEV_INFO(const DEV_INFO& a)
{ p = a.p? new AClass(*a.p): 0; }
DEV_INFO& operator=(const DEV_INFO& a)
{ delete p; a.p? p = new AClass(*a.p): 0; }
};
In this situation, assignment copy and destructor assume that the
p
pointer is either null or valid.
But the default constructor doesn't provide any initialization for it.
On many systems, dynamic allocated memory is initialized to "zero" before it is given to the program, so p is
incidetaly
set to NULL.
But other compiler (especially in debug release) pre-fill the pointer with random data. So
delete p
will be anymore trustable.
This sample can be properly corrected with
DEV_INFO::DEV_INFO() :p() {}
thus giving to p a null value.
Another possible problem can be default-ctor, copy and assign not implemented (so p, is simply copyed, but all copy point to a same address) and dtor does "delete p".
You didn't give enough information about the way your structure behaves. But those are the things that should be first investigated.