I have read all the threads, but none seem to answer, specifically, the questions i have, so i decided to ask them here:
Am i leaking memory by writing my code as follows:
class SomeClass
: public QDialog,
public Ui_SomeForm
{
Q_OBJECT
.......
private:
....
};
class QDataWidgetMapper ;
class QSqlTableModel;
class QHeaderView ;
class SomeClass : public QDialog, public Ui_SomeForm
{
Q_OBJECT
.......
private:
QDataWidgetMapper *mapper;
QSqlTableModel *model;
QHeaderView *header;
....
};
To copy to clipboard, switch view to plain text mode
and in my constructor of SomeClass the pointers are all initialized as follows:
SomeClass
::SomeClass(QWidget *parent
){
setupUi(this);
......
.....
}
SomeClass::SomeClass(QWidget *parent )
: QDialog(parent)
{
setupUi(this);
......
model = new QSqlTableModel(this);
header = new QHeaderView(Qt::Horizontal,this);
mapper = new QDataWidgetMapper(this);
.....
}
To copy to clipboard, switch view to plain text mode
I do not call delete on any of these pointers. Am i doing something wrong here? Oh and i never get errors on memory leaks, i am just really trying to make sure i am not creating any.
Also, where would you recommend that i call delete?
I am using MSVS .NET 2003, with the QT-VS integration;
if i do have memory leaks, could you direct me to some fast and accurate debug application that i can run in .NET, that will help me to identify them?
also, if memory leaks occur while my programs run, is it a FACT that after the program closes the memory is returned to the operating system?
thanks in advance for your attention, your time is valuable and it is appreciated.
Bookmarks