title: Qt "The program has unexpectedly finished." on close
body: <p>I have project on QML 2 (Qt 5.2.1). It seems works fine.</p>
  
  <p>But when I close running project (<kbd>ALT</kbd>+<kbd>F4</kbd>, or whatever) in Qt Creator's "Application Output" (that thing at the bottom), after 1-2 sec, I get the following message:</p>
  
  <pre><code>The program has unexpectedly finished.
  bla-bla-bla.exe crashed
  </code></pre>
  
  <p>This happens in release and debug modes. I Launched under debug, but not got any errors. I follow step-by-step from my last destructor till the very <code>return app.exec();</code>, which return 1.</p>
  
  <p>I mean except this - I don't see any errors. Should I worry about this? Can I know a reason for this message? Is there a way to get more specific message?</p>
  
  <hr>
  
  <p>I tried to launch application from <code>cmd</code>, but not get any errors. My <code>main.cpp</code>:</p>
  
  <pre><code>#include &lt;QtGui/QGuiApplication&gt;
  #include "qtquick2applicationviewer.h"
  #include "painter.h"
  
  int main(int argc, char *argv[])
  {
      QGuiApplication app(argc, argv);
  
      qmlRegisterType&lt;Painter&gt;("MyCanvas", 1, 0, "MyCanvas");
  
      QtQuick2ApplicationViewer viewer;
      viewer.setMainQmlFile(QStringLiteral("qml/test_painteditem/main.qml"));
      viewer.showExpanded();    
  
      return app.exec();
  }
  </code></pre>
  
  <p>Main.qml:</p>
  
  <pre><code>import QtQuick 2.0
  import MyCanvas 1.0
  
  Rectangle {
      width: 360
      height: 360
      color: "white";
       focus: true;
      Keys.onLeftPressed: {
              mc.frame--;
              mc.update();
      }
      Keys.onRightPressed: {
              mc.frame++;
              mc.update();
      }
      Keys.onPressed: {
          if (event.key === Qt.Key_C){
               mc.switchCurve();
          }else if (event.key === Qt.Key_O){
              mc.switchCurveOffset();
         }    
     }
  
     MouseArea {
          anchors.fill: parent
          onClicked: {
              // mc.x += 10;
              //mc.update();
              if (!tim.running){
                  tim.start();
              } else {
                  tim.stop();
              }
          }
          onWheel: {
                  if (wheel.angleDelta.y &gt; 0)
                      mc.zoomIn();
                  else
                      mc.zoomOut();
          }
          onPressed: {    
          }
      }
  
      Timer {
          id:tim
          interval: 1; running: false; repeat: true
          onTriggered:  {    
              mc.frame++;
              mc.update();
          }
      }    
  
      MyCanvas {
          id:mc;
          x:0;
          y:0;
          width:1000;         /** 2000x2000 not supported in Android  */
          height:1000;
      }
  }
  </code></pre>