<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Whether Dialog window&#x27;s object&#x27;s memory is leaking or not ?]]></title><description><![CDATA[<pre><code class="language-cpp">void MainWindow::on_pushButton_clicked()
{
    toDoList = new Dialog(this);
    toDoList-&gt;exec();
    int code = toDoList-&gt;result();

    // print dialog code returned
    switch(code){
    case 0:
        qDebug()&lt;&lt; "Rejected Dialog code is returned "&lt;&lt;Qt::endl;
        break;
    case 1:
        qDebug()&lt;&lt; "Accepted Dialog code is returned "&lt;&lt; Qt::endl;
        break;
    default:
        qDebug()&lt;&lt; "Nothing is return form Dialog Window"&lt;&lt; Qt::endl;

    }
}
</code></pre>
<p dir="auto">I just want to know if Somewhere ; memory is leaking or not of dialog window object because i am not deleting it before function return because. Thanks for you  valuable reply in advance.</p>
]]></description><link>https://forum.qt.io/topic/144478/whether-dialog-window-s-object-s-memory-is-leaking-or-not</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 05:51:47 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/144478.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Apr 2023 19:29:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Whether Dialog window&#x27;s object&#x27;s memory is leaking or not ? on Tue, 18 Apr 2023 19:34:13 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">Your not deleting it at all so yes the memory use will increase until MainWindow is deleted.</p>
<p dir="auto">Create your dialog on the stack, the way you use it does not justify to use the heap.</p>
]]></description><link>https://forum.qt.io/post/755234</link><guid isPermaLink="true">https://forum.qt.io/post/755234</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 18 Apr 2023 19:34:13 GMT</pubDate></item><item><title><![CDATA[Reply to Whether Dialog window&#x27;s object&#x27;s memory is leaking or not ? on Tue, 18 Apr 2023 19:33:48 GMT]]></title><description><![CDATA[<p dir="auto">It does not leak, it's cleaned up when MainWindow gets destroyed as described in the <a href="https://doc.qt.io/qt-6/objecttrees.html" target="_blank" rel="noopener noreferrer nofollow ugc">documentation</a>.</p>
]]></description><link>https://forum.qt.io/post/755233</link><guid isPermaLink="true">https://forum.qt.io/post/755233</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Tue, 18 Apr 2023 19:33:48 GMT</pubDate></item></channel></rss>