title: Understanding QTimer with Lambda and recursive function call
body: <p>I have the following code:</p>
  
  <pre><code>void class::Testfunc()
  {
      QTimer* timer = new QTimer;
      QObject::connect(timer, &amp;QTimer::timeout, [this](){
          emit Log("Time out...");
          TestFunc(serverAddress, requestsFolderPath);
         // deleteLater(); //*** why does this crash if used to replace the connect below?
      });
      connect(timer, &amp;QTimer::timeout, timer, &amp;QTimer::deleteLater);
      timer-&gt;setSingleShot(true);
      timer-&gt;start(1000);
  }
  </code></pre>
  
  <p>A single shot timer is created with a timout connected to a lambda function that logs the entrance to the lambda function each second (prints text to stdout) and calls the function again.</p>
  
  <p>This works without issue. However, if I remove the connect call to deleteLater (below the lambda function), but enable the deleteLater call in the lambda function, the function fails. It prints once and shortly after, crashes in trying to delete the timer object.</p>
  
  <p>What is the difference between the two deleteLater calls in this instance and why would placing the deleteLater in the lambda function cause a problem here, whereas creating a separate connection works as expected, even though both are calling deleteLater in response to the Timer's timeout signal?</p>