I am attempting the tutorial "part2" on http://doc.qt.nokia.com/4.7/gettingstartedqt.html. part1 successfully compiled and ran.

part2, however, is giving me an assertion fail when I exit it.
Qt Code:
  1. File: f:\dd\vctools\crt_bld\self_x86\crt\src\dbgdel.cpp
  2. Line: 52
  3.  
  4. Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
To copy to clipboard, switch view to plain text mode 

This is when I clicked the red X, click the Quit button (part of the tutorial), or Alt-F4.

Here is the tutorial code:
Qt Code:
  1. #include <QtGui>
  2.  
  3. int main(int argv, char **args)
  4. {
  5. QApplication app(argv, args);
  6.  
  7. QTextEdit textEdit;
  8. QPushButton quitButton("Quit");
  9.  
  10. QObject::connect(&quitButton, SIGNAL(clicked()), qApp, SLOT(quit()));
  11.  
  12. QVBoxLayout layout;
  13. layout.addWidget(&textEdit);
  14. layout.addWidget(&quitButton);
  15.  
  16. QWidget window;
  17. window.setLayout(&layout);
  18.  
  19. window.show();
  20.  
  21. return app.exec();
  22. }
To copy to clipboard, switch view to plain text mode 

I've noticed that if the layout.addWidget(... lines are commented out, it does not produce an assertion error.

What could be causing this to happen?
Thanks.