Fixed memory leak
This commit is contained in:
parent
74c34370e2
commit
e0635a4218
17
src/main.cpp
17
src/main.cpp
|
@ -9,11 +9,17 @@ int main(int argc, char** argv)
|
|||
Signal sig;
|
||||
|
||||
RenderWindow* window;
|
||||
DummyScreen* ds;
|
||||
PlotScreen* ps;
|
||||
try
|
||||
{
|
||||
window = new RenderWindow(800, 800);
|
||||
window->AddScreen(new DummyScreen(window->renderer, 0, 0, 800, 800));
|
||||
window->AddScreen(new PlotScreen(window->renderer, &sig, 50, 50, 700, 300, 0, -1.5f, 10, 1.5f));
|
||||
|
||||
ds = new DummyScreen(window->renderer, 0, 0, 800, 800);
|
||||
ps = new PlotScreen(window->renderer, &sig, 50, 50, 700, 300, 0, -1.5f, 10, 1.5f);
|
||||
|
||||
window->AddScreen(ds);
|
||||
window->AddScreen(ps);
|
||||
}
|
||||
catch (const std::runtime_error& e)
|
||||
{
|
||||
|
@ -23,5 +29,12 @@ int main(int argc, char** argv)
|
|||
|
||||
window->Run();
|
||||
|
||||
window->RemoveScreen(ps);
|
||||
window->RemoveScreen(ds);
|
||||
|
||||
delete ps;
|
||||
delete ds;
|
||||
delete window;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue