Am 25.04.2022 um 17:30 schrieb Michael Van Canneyt via fpc-pascal:
On Mon, 25 Apr 2022, Thomas Kurz via fpc-pascal wrote:
I cannot remember why, but a long time ago when learning Delphi 5 or
6, I
have learned not to call the destructor from within any method of the
class, only from outside.
On Mon, 25 Apr 2022, Thomas Kurz via fpc-pascal wrote:
I cannot remember why, but a long time ago when learning Delphi 5 or 6, I
have learned not to call the destructor from within any method of the
class, only from outside. If this is no longer true nowadays (or maybe,
has never been true
EDIT: The code should be "TThread.ForceQueue", not "TThread.Synchronize"; I
have corrected that.
I cannot remember why, but a long time ago when learning Delphi 5 or 6, I have
learned not to call the destructor from within any method of the class, only
from outside. If this is no longer true
I cannot remember why, but a long time ago when learning Delphi 5 or 6, I have
learned not to call the destructor from within any method of the class, only
from outside. If this is no longer true nowadays (or maybe, has never been true
before), I'd like to use this solution.
Just to be sure
On Mon, 25 Apr 2022, Thomas Kurz via fpc-pascal wrote:
This is a very elegant solution but it can only be used for Synchronize,
right? Because with ForceQueue I cannot know when it's done and freeing
within Run (i.e. "Self.Free") would fail.
Why would this fail according to you ?
I have
This is a very elegant solution but it can only be used for Synchronize, right?
Because with ForceQueue I cannot know when it's done and freeing within Run
(i.e. "Self.Free") would fail.
Using an advanced record would be fine, but it doesn't fit the declaration
"TThreadMethod = procedure of
On Mon, 25 Apr 2022 15:47:57 +0200
Thomas Kurz via fpc-pascal wrote:
>[...]
> As far as I have seen so far, the common solution is to use a
> variable inside the class to cache the parameters, then to use a
> DoCallSync procedure which takes no parameters but can use the cached
> values inside,