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 @@
- LD_LIBRARY_PATH must contain dir's path to libsandbox.so
- 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
```
......@@ -30,6 +30,8 @@ BeamerLocationGui::BeamerLocationGui(SandboxSetup *_setup, MonitorGui *_mg, QWid
BeamerLocationGui::~BeamerLocationGui()
{
delete timer;
myThread->quit();
myThread->wait();
delete myThread;
delete mut;
delete winFullScreen;
......@@ -37,13 +39,13 @@ BeamerLocationGui::~BeamerLocationGui()
}
void BeamerLocationGui::valideRoutine(){
endRoutine();
beamer->setPosition( (cv::Point3f)beamer->approximatePosition(&bases, &directions) );
//endRoutine();
//beamer->setPosition( (cv::Point3f)beamer->approximatePosition(&bases, &directions) );
endSuccess = true;
}
void BeamerLocationGui::cancelRoutine(){
endRoutine();
//endRoutine();
endSuccess = false;
}
......@@ -59,6 +61,8 @@ void BeamerLocationGui::showEvent(QShowEvent *event){
void BeamerLocationGui::closeEvent(QCloseEvent *e){
endRoutine();
if(endSuccess)
beamer->setPosition( (cv::Point3f)beamer->approximatePosition(&bases, &directions) );
QWidget::closeEvent(e);
}
......@@ -77,7 +81,7 @@ void BeamerLocationGui::startRoutine(){
updateLabelSteps();
if(myThread->isRunning()){
myThread->exit(0);
myThread->quit();
myThread->wait();
}
......@@ -167,7 +171,7 @@ void BeamerLocationGui::userValidePoint(){
void BeamerLocationGui::endRoutine(){
timer->stop();
myThread->exit(0);
myThread->quit();
myThread->wait();
endSuccess = (bases.size() == beamer->MAX_LINEAR_LINE_POINTS && directions.size() == beamer->MAX_LINEAR_LINE_POINTS);
......
......@@ -31,7 +31,7 @@ CameraFocusGui::~CameraFocusGui()
{
delete frameTimer;
delete blackScreen;
myThread->exit(0);
myThread->quit();
myThread->wait();
delete myThread;
delete ui;
......@@ -50,9 +50,14 @@ void CameraFocusGui::showEvent(QShowEvent *event){
frameTimer->start(100);
}
// TODO : Fixe bug timer
void CameraFocusGui::closeEvent(QCloseEvent *event){
frameTimer->stop();
myThread->quit();
myThread->wait();
blackScreen->close();
QWidget::closeEvent(event);
}
......
......@@ -26,11 +26,11 @@ InitCameraGui::InitCameraGui(SandboxSetup *_setup, QWidget *parent) :
workerThread = new CameraStartThread(setup->getCamera());
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()
{
{
workerThread->quit();
workerThread->wait();
delete workerThread;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment