Panic USER 8 after append data two times in HBufC reallocated Descriptor.
| Sat, 2007-08-18 15:57 | |
|
|
Get Panic USER-8 when i=2 that data not copy into the descriptor. my String is: "Abcdef i Get string only: "Abcdef <" please check my code and tell me my mistake. i am very Confused that where is the problem!!!! please you can help me pleeeeeeeeeese............. void CArrayHandler::EndElement(const TDesC& aElemName) HBufC* log = HBufC::NewLC(aElemName.Length() + 8); TInt arrEleCount = 0; TInt i = 0; elementLen = ( (*iColumnData)[0] ).Length(); for( i=0 ; i coldata->Des().Append( (*iColumnData)[i] ); elementLen = ( (*iColumnData)[loop+1] ).Length(); } } } // end if arrEleCount } } |






Forum posts: 162
Dear SymbianTG,
There are other issues, besides just the panic. One by one:
1. Please read the Symbian OS documentation on the panic code. Here's what it says:
This panic is raised when a length value passed to a 16-bit variant descriptor member function is invalid. It may be raised by some descriptor constructors and, specifically, by the Replace() and Set() descriptor member functions. That should give you a good hint as to where things are getting wrong...
2. Don't use HBuf! See this for descriptor usage guides.
3. The
EndElementmethod signature suggests its non leaving, however, you are calling leaving functions inside and NOT even bothering to push objects into the cleanup stack. Very messy!4. The
EndElementmethod can be optimised and re-written to be more readable. You seem to be allocating and creating variables when they are not needed.Finally, what on earth is your function trying to achive? It looks like it can be solved in a lot better way...
http://www.tanzim.co.uk