Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Fixed various deallocations
Browse files Browse the repository at this point in the history
MPIBR-kretschmerf committed Jun 9, 2017
1 parent 704655f commit 2855c54
Showing 5 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion NIDAQmxInterface.cpp
Original file line number Diff line number Diff line change
@@ -18,6 +18,11 @@ NIDAQmxInterface::NIDAQmxInterface(QObject* parent) : QObject(parent)
daq = new DAQmxEngine();
}

NIDAQmxInterface::~NIDAQmxInterface()
{
delete daq;
}

void NIDAQmxInterface::DAQmxInitializeInterface()
{
/* initialize daq pointer */
@@ -305,7 +310,6 @@ int32 CVICALLBACK NIDAQmxInterface::FcnCbckDetectDI(TaskHandle taskHandle, int32
DAQmxTriggerDO(DAQ_PORT_DO_WATER, TRUE);
qDebug()<<"Water reward!";
}

}

/* update bit history */
1 change: 1 addition & 0 deletions NIDAQmxInterface.h
Original file line number Diff line number Diff line change
@@ -77,6 +77,7 @@ class NIDAQmxInterface: public QObject
bool isPaused = false; //ignore input/output when true

explicit NIDAQmxInterface(QObject *parent = 0);
~NIDAQmxInterface();
/* function prototypes */
void DAQmxInitializeInterface();
void DAQmxDestroyInterface();
5 changes: 3 additions & 2 deletions SocketClient.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "SocketClient.h"

SocketClient::SocketClient(QWidget *parent)
SocketClient::SocketClient(QObject *parent) : QObject(parent)
{
tcpSocket = new QTcpSocket();
tcpSocket = new QTcpSocket(this);

inBuffer.open(QIODevice::ReadWrite);
inStream.setDevice(&inBuffer);
@@ -42,6 +42,7 @@ void SocketClient::onReadData()
char* data = new char[dataSize];
inStream >> data;
QString fileName(data);
delete data;
emit(socketFileName(fileName));
qDebug()<<"Socket: filename" << fileName;
}
2 changes: 1 addition & 1 deletion SocketClient.h
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ class SocketClient : public QObject
Q_OBJECT

public:
explicit SocketClient(QWidget *parent = Q_NULLPTR);
explicit SocketClient(QObject *parent = Q_NULLPTR);
void connectToHost();

private slots:
4 changes: 3 additions & 1 deletion StateMachineController.cpp
Original file line number Diff line number Diff line change
@@ -107,15 +107,17 @@ StateMachineController::~StateMachineController()
if(logFileThread){
logFileThread->quit();
logFileThread->wait();
delete logFileWriter;
}
if(socketThread){
socketThread->quit();
socketThread->wait();
delete socketClient;
}

delete timerDialog;
delete nidaq;
delete tdt;
delete logFileWriter;
}

void StateMachineController::startStateMachine(audioGameSettings settings)

0 comments on commit 2855c54

Please sign in to comment.