ResetAndDestroy leaves?
| Sun, 2005-02-06 15:03 | |
|
Hi,
I have the following code in one of my classes definition: class A { ... typedef TBufC<MAX_LOG_OP_NAME> TOpName; typedef struct { TOpName m_opName; TTime m_timeStarted; } OpInfoStruct; typedef CArrayPtrFlat<OpInfoStruct> OpInfoArray; OpInfoArray m_operations; .... }; In ~A() I call m_operations.ResetAndDestroy() which leaves unexpectedlly (I get the App closed message). Any ideas? Thanx Yaron Tadmor |
|






Forum posts: 75
In ~A() I call m_operations.ResetAndDestroy() which leaves unexpectedlly (I get the App closed message).
Any ideas?
Thanx
Yaron Tadmor
It's very unlikely that ResetAndDestroy leaves, because it doesn't end with L. What you are experiencing is probably a Panic, not a Leave. There are many reasons why it could panic. Most likey, that's double deallocation. Knowing the panic number/category would help. Check debug output from the emulator.
-Slava
Forum posts: 586
CArrayPtrFlat is derived from CBase and A is not. CArrayPtrFlat, assumes CBase operator new will zero it's memory.
I changed m_operations to be a pointer member and it's ok now.