Added constructor and destructor to Dialogue, thus fixing a long standing leak.

svn-id: r32757
This commit is contained in:
Nicola Mettifogo 2008-06-22 14:46:08 +00:00
parent 4e2e46f16c
commit d2609258cc
2 changed files with 13 additions and 0 deletions

View File

@ -207,6 +207,16 @@ uint16 Zone::height() const {
return _bottom - _top;
}
Dialogue::Dialogue() {
memset(_questions, 0, sizeof(_questions));
}
Dialogue::~Dialogue() {
for (int i = 0; i < NUM_QUESTIONS; i++) {
delete _questions[i];
}
}
Answer::Answer() {
_text = NULL;
_mood = 0;

View File

@ -181,6 +181,9 @@ struct Question {
struct Dialogue {
Question *_questions[NUM_QUESTIONS];
Dialogue();
~Dialogue();
};
struct GetData { // size = 24