foreach++, globals--, const& params++, new--, uninit mem usage--, mem leaks-- (still a lot to go)

This commit is contained in:
Mathias Panzenböck
2014-02-16 00:37:54 +01:00
parent 683fa64f01
commit 904a843b93
17 changed files with 213 additions and 208 deletions

View File

@ -15,13 +15,11 @@ Axis::Axis( int i, QObject *parent ) : QObject(parent) {
gradient = false;
toDefault();
tick = 0;
timer = new QTimer(this);
}
Axis::~Axis() {
release();
delete timer;
}
bool Axis::read( QTextStream &stream ) {
@ -210,8 +208,8 @@ void Axis::jsevent( int value ) {
if (gradient) {
duration = 0;
release();
timer->stop();
disconnect(timer, SIGNAL(timeout()), 0, 0);
timer.stop();
disconnect(&timer, SIGNAL(timeout()), 0, 0);
tick = 0;
}
}
@ -220,8 +218,8 @@ void Axis::jsevent( int value ) {
isOn = true;
if (gradient) {
duration = (abs(state) * FREQ) / JOYMAX;
connect(timer, SIGNAL(timeout()), this, SLOT(timerCalled()));
timer->start(MSEC);
connect(&timer, SIGNAL(timeout()), this, SLOT(timerCalled()));
timer.start(MSEC);
}
}
//otherwise, state doesn't change! Don't touch it.