| 6236 | } |
| 6237 | |
| 6238 | void asCCompiler::DestroyVariables(asCByteCode *bc) |
| 6239 | { |
| 6240 | // Call destructor on all variables except for the function parameters |
| 6241 | // Put the clean-up in a block to allow exception handler to understand this |
| 6242 | bc->Block(true); |
| 6243 | asCVariableScope *vs = variables; |
| 6244 | while( vs ) |
| 6245 | { |
| 6246 | for( int n = (int)vs->variables.GetLength() - 1; n >= 0; n-- ) |
| 6247 | if( vs->variables[n]->stackOffset > 0 ) |
| 6248 | CallDestructor(vs->variables[n]->type, vs->variables[n]->stackOffset, vs->variables[n]->onHeap, bc); |
| 6249 | |
| 6250 | vs = vs->parent; |
| 6251 | } |
| 6252 | bc->Block(false); |
| 6253 | } |
| 6254 | |
| 6255 | void asCCompiler::AddVariableScope(bool isBreakScope, bool isContinueScope) |
| 6256 | { |