mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-29 06:54:22 +01:00
Delete everything on exit
This commit is contained in:
parent
cd1768a140
commit
112154d17a
22
gui.cpp
22
gui.cpp
@ -99,6 +99,26 @@ Gui::Gui()
|
|||||||
this->bkv = NULL;
|
this->bkv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Gui::~Gui()
|
||||||
|
{
|
||||||
|
delete this->mv;
|
||||||
|
delete this->dv;
|
||||||
|
delete this->ov;
|
||||||
|
delete this->nv;
|
||||||
|
delete this->tv;
|
||||||
|
delete this->giv;
|
||||||
|
delete this->bkv;
|
||||||
|
|
||||||
|
delete this->cur_gameInfo;
|
||||||
|
delete this->timerController;
|
||||||
|
|
||||||
|
if (this->dlg)
|
||||||
|
delete this->dlg;
|
||||||
|
|
||||||
|
if (VirtualKeyboard::kbd)
|
||||||
|
delete VirtualKeyboard::kbd;
|
||||||
|
}
|
||||||
|
|
||||||
bool Gui::setTheme(const char *path)
|
bool Gui::setTheme(const char *path)
|
||||||
{
|
{
|
||||||
this->bg_left = this->loadThemeImage(path, "bg_left.png");
|
this->bg_left = this->loadThemeImage(path, "bg_left.png");
|
||||||
@ -340,7 +360,7 @@ void Gui::saveGameInfo()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int n = fwrite((const void*)p, 1, p->sz, fp);
|
int n = fwrite((const void*)p, 1, p->sz, fp);
|
||||||
if (n != p->sz)
|
if (n != (int)p->sz)
|
||||||
warning("Could only write %d bytes of %s\n", n, buf);
|
warning("Could only write %d bytes of %s\n", n, buf);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
10
main.cpp
10
main.cpp
@ -19,6 +19,9 @@ static void run(void)
|
|||||||
SDL_Event ev;
|
SDL_Event ev;
|
||||||
Uint32 now = SDL_GetTicks();
|
Uint32 now = SDL_GetTicks();
|
||||||
|
|
||||||
|
if (!Gui::gui->is_active)
|
||||||
|
break;
|
||||||
|
|
||||||
while (SDL_PollEvent(&ev)) {
|
while (SDL_PollEvent(&ev)) {
|
||||||
if (ev.type == SDL_QUIT)
|
if (ev.type == SDL_QUIT)
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -49,9 +52,16 @@ static void init(void)
|
|||||||
Gui::gui->activate();
|
Gui::gui->activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void fini(void)
|
||||||
|
{
|
||||||
|
delete Gui::gui;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
run();
|
run();
|
||||||
|
fini();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user