<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Am 10.02.2022 um 19:22 schrieb Thorsten
Otto via fpc-devel:<br>
</div>
<blockquote type="cite" cite="mid:17501750.PZ220tBoeq@earendil">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="qrichtext" content="1">
<style type="text/css">p, li { white-space: pre-wrap; }</style>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On Donnerstag, 10. Februar 2022 19:13:15 CET Sven Barth via fpc-devel wrote:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> And how does one work with the created instance? How does one release it? Do</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> you have an example for that?</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Maybe some examples of ObjectGEM itself, like <a href="https://github.com/th-otto/texel/tree/master/ogem/demo/zeit" moz-do-not-send="true"><span style=" text-decoration: underline; color:#0057ae;">https://github.com/th-otto/texel/tree/master/ogem/demo/zeit</span></a> </p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">I'm quite sure the buttons get properly destroyed when you destroy the dialog, but don't ask me where ;)</p>
</blockquote>
<br>
I've now looked at the original Texel code and it does indeed
register the new instance in the passed in parent instance (inside
TControl.Init()). So there would only be a memory leak if there
wouldn't be a parent, but that is rejected with a FAIL anyway.<br>
<br>
So we should fix that NEW() handling then, cause that is indeed a
valid usecase...<br>
<br>
(Obviously it's upon to user to handle this correctly then, but
that's the case with normal allocations as well, so... *shrugs*)<br>
<br>
Regards,<br>
Sven<br>
</body>
</html>