Fix memory leaks.

Use "/" separator for internal cmaobject nodes.
Use new vitamtp init function.
Remove console config for Win32.
This commit is contained in:
codestation
2013-09-22 19:02:42 -04:30
parent d2e584220e
commit 71a7bed50d
9 changed files with 44 additions and 22 deletions

View File

@@ -20,12 +20,18 @@
#include "clientmanager.h"
#include "progressform.h"
#include "cmaclient.h"
#include "utils.h"
ClientManager::ClientManager(QObject *parent) :
QObject(parent)
{
}
ClientManager::~ClientManager()
{
VitaMTP_Cleanup();
}
void ClientManager::databaseUpdated(int count)
{
progress.hide();
@@ -44,6 +50,12 @@ void ClientManager::showPinDialog(QString name, int pin)
void ClientManager::start()
{
if(VitaMTP_Init() < 0)
{
emit messageSent(tr("Cannot initialize VitaMTP library"));
return;
}
// initializing database for the first use
refreshDatabase();
CmaEvent::db = &db;
@@ -102,7 +114,9 @@ void ClientManager::refreshDatabase()
void ClientManager::stop()
{
CmaClient::stop();
if(CmaClient::stop() < 0) {
emit stopped();
}
}
void ClientManager::threadStopped()