Hi,

I have a program in which i create a new dialog. It doesn't happen every time i create that dialog, but when i close the dialog and create it again after enough attempts the program crashes.

I create the dialog from a mainwindow with the following code

Qt Code:
  1. void MainWindow::newServer()
  2. {
  3. serverScreen = new newServerScreen();
  4. serverScreen->setParent(this);
  5. serverScreen->setWindowFlags(Qt::Window);
  6. serverScreen->setAttribute(Qt::WA_DeleteOnClose);
  7. serverScreen->setAttribute(Qt::WA_ShowModal);
  8. serverScreen->show();
  9. }
To copy to clipboard, switch view to plain text mode 

the code of the dialog is as follows
newServerScreen.h:
Qt Code:
  1. #ifndef NEWSERVERSCREEN_H
  2. #define NEWSERVERSCREEN_H
  3.  
  4. #include <QDialog>
  5. #include <QLineEdit>
  6. #include <QCheckBox>
  7. #include <QComboBox>
  8. #include <QLabel>
  9.  
  10. #include <server.h>
  11.  
  12. class newServerScreen : public QDialog
  13. {
  14. public:
  15. newServerScreen();
  16.  
  17. //Widgets
  18. QLineEdit *Addres;
  19. QLineEdit *Nickname;
  20. QLineEdit *Username;
  21. QLineEdit *Password;
  22. QCheckBox *UseSsl;
  23. QCheckBox *RequireLogin;
  24. QComboBox *Connections;
  25.  
  26. QLabel *labelAddres;
  27. QLabel *labelNickname;
  28. QLabel *labelUsername;
  29. QLabel *labelPassword;
  30. QLabel *labelConnections;
  31.  
  32. private:
  33. void createInterface();
  34. void createActions();
  35.  
  36. Server *newServer;
  37. };
  38.  
  39. #endif // NEWSERVERSCREEN_H
To copy to clipboard, switch view to plain text mode 

newServerScreen.cpp:
Qt Code:
  1. #include "newserverscreen.h"
  2.  
  3. newServerScreen::newServerScreen()
  4. {
  5. this->createActions();
  6. this->createInterface();
  7. }
  8.  
  9. void newServerScreen::createActions()
  10. {
  11. }
  12.  
  13. void newServerScreen::createInterface()
  14. {
  15. this->setWindowTitle(tr("Add new server"));
  16. Addres = new QLineEdit();
  17. Nickname = new QLineEdit();
  18. Username = new QLineEdit();
  19. Password = new QLineEdit();
  20. UseSsl = new QCheckBox();
  21. RequireLogin = new QCheckBox();
  22. Connections = new QComboBox();
  23. labelAddres = new QLabel();
  24. labelNickname = new QLabel();
  25. labelUsername = new QLabel();
  26. labelPassword = new QLabel();
  27. labelConnections = new QLabel();
  28. }
To copy to clipboard, switch view to plain text mode 

When i comment out all the lines with new in them in the newServerScreen.cpp file the program doesn't crash.

Once i got the following output from the program in QtCreator:
Qt Code:
  1. Starting O:/projects/Post_Program/debug/Post_Program.exe...
  2. ASSERT: "r->d_func()->postedEvents >= 0" in file kernel\qcoreapplication.cpp, line 1235
  3. Invalid parameter passed to C runtime function.
  4. Invalid parameter passed to C runtime function.
  5. QMutex::lock: Deadlock detected in thread 8976
To copy to clipboard, switch view to plain text mode 

I don't know what i did different that time because i can't replicate it.

I program in QtCreator 1.1.0 with Qt 4.5.1 on a Windows 7 RC 64bit


Thanks in advance