From dd508088e8c1f325402abe4d796fa49024a1044b Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Tue, 2 Feb 2016 19:24:08 +0100 Subject: [PATCH] Adapt to new `GridWarpSurface` related interface Additionally remove destructors as they caused SIGABRT errors when shutting down the application --- src/Application/Application.cpp | 5 ----- src/Application/Application.h | 1 - src/Application/ProjectionMappingState.cpp | 12 ++++-------- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/Application/Application.cpp b/src/Application/Application.cpp index 30ae9e1..d8896c1 100644 --- a/src/Application/Application.cpp +++ b/src/Application/Application.cpp @@ -14,11 +14,6 @@ Application::Application(){ ofAddListener(ofEvents().keyPressed, this, &Application::onKeyPressed); } -Application::~Application(){ - setState(0); - ofRemoveListener(ofEvents().keyPressed, this, &Application::onKeyPressed); -} - void Application::setup(){ if(!loadXmlSettings(PIMAPPER_USER_SURFACES_XML_FILE)){ ofLogWarning("Application::setup()") << "Failed to load user settings" << endl; diff --git a/src/Application/Application.h b/src/Application/Application.h index 3b8a5d7..49dfeaa 100644 --- a/src/Application/Application.h +++ b/src/Application/Application.h @@ -30,7 +30,6 @@ class Application { public: Application(); - ~Application(); ApplicationBaseState * getState(); diff --git a/src/Application/ProjectionMappingState.cpp b/src/Application/ProjectionMappingState.cpp index 286dc6b..cbab5b8 100644 --- a/src/Application/ProjectionMappingState.cpp +++ b/src/Application/ProjectionMappingState.cpp @@ -73,8 +73,7 @@ void ProjectionMappingState::onKeyPressed(Application * app, ofKeyEventArgs & ar // TODO: The command should not require projection editor pointer app->getCmdManager()->exec( new AddGridRowCmd( - (GridWarpSurface *)app->getSurfaceManager()->getSelectedSurface(), - app->getGui()->getProjectionEditor() )); + (GridWarpSurface *)app->getSurfaceManager()->getSelectedSurface() )); } } break; @@ -88,8 +87,7 @@ void ProjectionMappingState::onKeyPressed(Application * app, ofKeyEventArgs & ar // TODO: The command should not require projection editor pointer app->getCmdManager()->exec( new RmGridRowCmd( - (GridWarpSurface *)app->getSurfaceManager()->getSelectedSurface(), - app->getGui()->getProjectionEditor() )); + (GridWarpSurface *)app->getSurfaceManager()->getSelectedSurface() )); } } } @@ -103,8 +101,7 @@ void ProjectionMappingState::onKeyPressed(Application * app, ofKeyEventArgs & ar // TODO: The command should not require projection editor pointer app->getCmdManager()->exec( new AddGridColCmd( - (GridWarpSurface *)app->getSurfaceManager()->getSelectedSurface(), - app->getGui()->getProjectionEditor() )); + (GridWarpSurface *)app->getSurfaceManager()->getSelectedSurface() )); } } break; @@ -118,8 +115,7 @@ void ProjectionMappingState::onKeyPressed(Application * app, ofKeyEventArgs & ar // TODO: The command should not require projection editor pointer app->getCmdManager()->exec( new RmGridColCmd( - (GridWarpSurface *)app->getSurfaceManager()->getSelectedSurface(), - app->getGui()->getProjectionEditor() )); + (GridWarpSurface *)app->getSurfaceManager()->getSelectedSurface() )); } } }