Hi,
using QT 3.3.4 on amd64 KUbuntu breezy,
I'm trying to delete a QDir I created in a QObject created in a QWidget. The routine is the following:
void mount::mountCheck() // check if directory is mounted (more then 2 entries)
{
if( d.count() > 2) { // more then 2 entries, dir mounted ('.', '..' + something)
emit sigMOk();
// ????? delete d here ?????
} else {
mountProc();
}
}
void mount::mountCheck() // check if directory is mounted (more then 2 entries)
{
QDir d( sMDir );
if( d.count() > 2) { // more then 2 entries, dir mounted ('.', '..' + something)
emit sigMOk();
// ????? delete d here ?????
} else {
mountProc();
}
}
To copy to clipboard, switch view to plain text mode
Running through this the 1st time works well, but coming here a second time crashes the program - system becomes unresponsive.
I suspect the QDir d is not deleted as the QObject is not deleted either, which is OK, I need it later. Defining QDir d a 2nd time might cause the fault.
Could somebody please give me the magic line of code how to delete the QDir d at the remark line in above code?
The QDir Class Reference says:
QDir::~QDir () [virtual]
Destroys the QDir frees up its resources.
However, I cannot transfer this in a valid line of code. Whatever I try, I always get compile errors.
Bookmarks