diff --git a/src/main.cpp b/src/main.cpp index 237dabf..2558a98 100644 --- a/src/main.cpp +++ b/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; } \ No newline at end of file