Skip to content
Snippets Groups Projects
Commit d8dfc1b0 authored by simon.fanetti's avatar simon.fanetti
Browse files

fixed setup app ending seg fault

parent 0b649055
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
- LD_LIBRARY_PATH must contain dir's path to libsandbox.so - LD_LIBRARY_PATH must contain dir's path to libsandbox.so
- Enter this command in the terminal where you are using your application - Enter this command in the terminal where you are using your application
``` ```
REALTIVE_PATH_TO_SO=../ar_sandbox_lib/build && \ REALTIVE_PATH_TO_SO=../../ar_sandbox_lib/build && \
export LD_LIBRARY_PATH=$(pwd)/$REALTIVE_PATH_TO_SO export LD_LIBRARY_PATH=$(pwd)/$REALTIVE_PATH_TO_SO
``` ```
...@@ -30,6 +30,8 @@ BeamerLocationGui::BeamerLocationGui(SandboxSetup *_setup, MonitorGui *_mg, QWid ...@@ -30,6 +30,8 @@ BeamerLocationGui::BeamerLocationGui(SandboxSetup *_setup, MonitorGui *_mg, QWid
BeamerLocationGui::~BeamerLocationGui() BeamerLocationGui::~BeamerLocationGui()
{ {
delete timer; delete timer;
myThread->quit();
myThread->wait();
delete myThread; delete myThread;
delete mut; delete mut;
delete winFullScreen; delete winFullScreen;
...@@ -37,13 +39,13 @@ BeamerLocationGui::~BeamerLocationGui() ...@@ -37,13 +39,13 @@ BeamerLocationGui::~BeamerLocationGui()
} }
void BeamerLocationGui::valideRoutine(){ void BeamerLocationGui::valideRoutine(){
endRoutine(); //endRoutine();
beamer->setPosition( (cv::Point3f)beamer->approximatePosition(&bases, &directions) ); //beamer->setPosition( (cv::Point3f)beamer->approximatePosition(&bases, &directions) );
endSuccess = true; endSuccess = true;
} }
void BeamerLocationGui::cancelRoutine(){ void BeamerLocationGui::cancelRoutine(){
endRoutine(); //endRoutine();
endSuccess = false; endSuccess = false;
} }
...@@ -59,6 +61,8 @@ void BeamerLocationGui::showEvent(QShowEvent *event){ ...@@ -59,6 +61,8 @@ void BeamerLocationGui::showEvent(QShowEvent *event){
void BeamerLocationGui::closeEvent(QCloseEvent *e){ void BeamerLocationGui::closeEvent(QCloseEvent *e){
endRoutine(); endRoutine();
if(endSuccess)
beamer->setPosition( (cv::Point3f)beamer->approximatePosition(&bases, &directions) );
QWidget::closeEvent(e); QWidget::closeEvent(e);
} }
...@@ -77,7 +81,7 @@ void BeamerLocationGui::startRoutine(){ ...@@ -77,7 +81,7 @@ void BeamerLocationGui::startRoutine(){
updateLabelSteps(); updateLabelSteps();
if(myThread->isRunning()){ if(myThread->isRunning()){
myThread->exit(0); myThread->quit();
myThread->wait(); myThread->wait();
} }
...@@ -167,7 +171,7 @@ void BeamerLocationGui::userValidePoint(){ ...@@ -167,7 +171,7 @@ void BeamerLocationGui::userValidePoint(){
void BeamerLocationGui::endRoutine(){ void BeamerLocationGui::endRoutine(){
timer->stop(); timer->stop();
myThread->exit(0); myThread->quit();
myThread->wait(); myThread->wait();
endSuccess = (bases.size() == beamer->MAX_LINEAR_LINE_POINTS && directions.size() == beamer->MAX_LINEAR_LINE_POINTS); endSuccess = (bases.size() == beamer->MAX_LINEAR_LINE_POINTS && directions.size() == beamer->MAX_LINEAR_LINE_POINTS);
......
...@@ -31,7 +31,7 @@ CameraFocusGui::~CameraFocusGui() ...@@ -31,7 +31,7 @@ CameraFocusGui::~CameraFocusGui()
{ {
delete frameTimer; delete frameTimer;
delete blackScreen; delete blackScreen;
myThread->exit(0); myThread->quit();
myThread->wait(); myThread->wait();
delete myThread; delete myThread;
delete ui; delete ui;
...@@ -50,9 +50,14 @@ void CameraFocusGui::showEvent(QShowEvent *event){ ...@@ -50,9 +50,14 @@ void CameraFocusGui::showEvent(QShowEvent *event){
frameTimer->start(100); frameTimer->start(100);
} }
// TODO : Fixe bug timer
void CameraFocusGui::closeEvent(QCloseEvent *event){ void CameraFocusGui::closeEvent(QCloseEvent *event){
frameTimer->stop(); frameTimer->stop();
myThread->quit();
myThread->wait();
blackScreen->close(); blackScreen->close();
QWidget::closeEvent(event); QWidget::closeEvent(event);
} }
......
...@@ -26,11 +26,11 @@ InitCameraGui::InitCameraGui(SandboxSetup *_setup, QWidget *parent) : ...@@ -26,11 +26,11 @@ InitCameraGui::InitCameraGui(SandboxSetup *_setup, QWidget *parent) :
workerThread = new CameraStartThread(setup->getCamera()); workerThread = new CameraStartThread(setup->getCamera());
connect(workerThread, &CameraStartThread::setupReady, this, &InitCameraGui::setupReady); connect(workerThread, &CameraStartThread::setupReady, this, &InitCameraGui::setupReady);
connect(workerThread, &CameraStartThread::finished, workerThread, &QObject::deleteLater); //connect(workerThread, &QThread::finished, workerThread, &QObject::deleteLater); // delete thread when finished
} }
InitCameraGui::~InitCameraGui() InitCameraGui::~InitCameraGui()
{ {
workerThread->quit(); workerThread->quit();
workerThread->wait(); workerThread->wait();
delete workerThread; delete workerThread;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment