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:

Qt Code:
  1. void mount::mountCheck() // check if directory is mounted (more then 2 entries)
  2. {
  3. QDir d( sMDir );
  4. if( d.count() > 2) { // more then 2 entries, dir mounted ('.', '..' + something)
  5. emit sigMOk();
  6. // ????? delete d here ?????
  7. } else {
  8. mountProc();
  9. }
  10. }
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.