...
Code Block | ||
---|---|---|
| ||
while (moreToDo) { SomeType *pst = getNextItem(); try { pst->processItem(); } catch (...) { // deal with exception throw; } delete pst; } |
The code above of the Non-Compliant Code Example does not recover the resources associated with the object pointed to by pst
in the event that processItem
throws an exception, thereby potentially causing a resource leak.
...