title: crash at exit when creating a QML application with Visual Studio and Qt 5.3
body: <p>I've been playing with QML application and extensions through qmlRegisterType, and I stumbled into a strange thing : I have 2 projects. The first one produces a dll with a custom QML type, and the second one is a really simple application which looks like this :</p>
  
  <p>main.cpp :</p>
  
  <pre><code>int main(int argc, char *argv[])
  {
      QGuiApplication app(argc, argv);
      QQmlApplicationEngine engine(QUrl("qrc:/main.qml"));
      return app.exec();
  }
  </code></pre>
  
  <p>main.qml</p>
  
  <pre><code>import QtQuick 2.3
  import QtQuick.Window 2.2
  import TestLib 1.0
  
  Window {
      visible: true
      width: 360
      height: 360
  
      MouseArea {
          anchors.fill: parent
          onClicked: {
              Qt.quit();
          }
      }
  
      HelloWorld {
          id: hello
          test: "Foo !!"
      }
  
      Text {
          anchors.centerIn: parent
          text: hello.test
          font.pointSize: 40
      }
  }
  </code></pre>
  
  <p>When I run my project through Qt Creator, everything works fine, and when I click anywhere on the window, it closes properly.</p>
  
  <p>But now, if I try to compile the exact same code through a Visual Studio project (I use and special version of Premake to generate the Visual Studio solution and project files which handle the Qt special files correctly) then everything compiles, runs fine, but as soon as I click on the window, I have a crash with the following callstack :</p>
  
  <pre><code>ntdll.dll!RtlFreeHeap() Unknown
  kernel32.dll!HeapFree() Unknown
  msvcr120.dll!free(void * pBlock) Line 51    C
  TestLib.dll!000007fef7bb6d6c()  Unknown
  Qt5Cored.dll!QObjectPrivate::deleteChildren() Line 1936 C++
  Qt5Cored.dll!QObject::~QObject() Line 1030  C++
  Qt5Quickd.dll!QQuickItem::~QQuickItem() Line 2120   C++
  Qt5Quickd.dll!QQuickRootItem::~QQuickRootItem() C++
  Qt5Quickd.dll!QQuickRootItem::`scalar deleting destructor'(unsigned int)    C++
  Qt5Quickd.dll!QQuickWindow::~QQuickWindow() Line 1102   C++
  Qt5Quickd.dll!QQuickWindowQmlImpl::~QQuickWindowQmlImpl()   C++
  Qt5Quickd.dll!QQmlPrivate::QQmlElement&lt;QQuickWindowQmlImpl&gt;::~QQmlElement&lt;QQuickWindowQmlImpl&gt;() Line 106   C++
  Qt5Quickd.dll!QQmlPrivate::QQmlElement&lt;QQuickWindowQmlImpl&gt;::`scalar deleting destructor'(unsigned int) C++
  Qt5Qmld.dll!qDeleteAll&lt;QList&lt;QObject * __ptr64&gt;::const_iterator&gt;(QList&lt;QObject *&gt;::const_iterator begin, QList&lt;QObject *&gt;::const_iterator end) Line 323 C++
  Qt5Qmld.dll!qDeleteAll&lt;QList&lt;QObject * __ptr64&gt; &gt;(const QList&lt;QObject *&gt; &amp; c) Line 332  C++
  Qt5Qmld.dll!QQmlApplicationEnginePrivate::cleanUp() Line 64 C++
  Qt5Qmld.dll!QQmlApplicationEngine::~QQmlApplicationEngine() Line 241    C++
  TestApp.exe!000000013faf2630()  Unknown
  TestApp.exe!000000013faf4197()  Unknown
  </code></pre>
  
  <p>I spent a lot of time browsing Google and such, but I couldn't find anything helpfull. I think that maybe I'm missing some compilation option in my projects, that Qt Creator automatically adds, but I don't know which one :/</p>
  
  <p>I know that just looking at this question will probably not be sufficient to find a solution, so I prepared a small project that perfectly reproduces the problem. If you're willing to try it, feel free to drop me a message, and I'll send it to you (I don't have any dropbox account or equivalent, unfortunately)</p>
  
  <p>Thanks in advance for any help !</p>