Freeing Function objects before destroying program.
This commit is contained in:
parent
72b6c0253a
commit
e93fef76f1
|
@ -264,6 +264,8 @@ class Function: public Emittable {
|
|||
public:
|
||||
Function(Id *n, IdList *a, StatementList *b):
|
||||
name(n), args(a), body(b) {}
|
||||
virtual ~Function() {}
|
||||
|
||||
virtual void emit(std::ostream &stream, int indent = 0);
|
||||
|
||||
private:
|
||||
|
@ -274,6 +276,12 @@ private:
|
|||
|
||||
class Program: public Emittable {
|
||||
public:
|
||||
virtual ~Program() {
|
||||
for (Function *f: functions) {
|
||||
delete f;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void emit(std::ostream &stream, int indent = 0);
|
||||
|
||||
void setMain(Main *m) {
|
||||
|
|
Reference in New Issue
Block a user