Am 10.02.2022 um 19:22 schrieb Thorsten Otto via fpc-devel:
On Donnerstag, 10. Februar 2022 19:13:15 CET Sven Barth via fpc-devel
wrote:
> And how does one work with the created instance? How does one
release it? Do
> you have an example for that?
Maybe some examples of ObjectGEM itself, like
https://github.com/th-otto/texel/tree/master/ogem/demo/zeit
<https://github.com/th-otto/texel/tree/master/ogem/demo/zeit>
I'm quite sure the buttons get properly destroyed when you destroy the
dialog, but don't ask me where ;)
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.
So we should fix that NEW() handling then, cause that is indeed a valid
usecase...
(Obviously it's upon to user to handle this correctly then, but that's
the case with normal allocations as well, so... *shrugs*)
Regards,
Sven
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel