[Oorexx-devel] Committed with [r12999] (Re: RFC (Re: Request for fixing crash reported in bug item #1872

2025-07-27 Thread Rony G. Flatscher
Committed with [r12999]: . ---rony On 27.07.2025 15:18, Rony G. Flatscher wrote: On 27.07.2025 15:04, Rick McGuire wrote: Actually, your version has a serious flaw in it. The line +InstanceDetacher instDet = InstanceDetacher(tmpInstance.

Re: [Oorexx-devel] RFC (Re: Request for fixing crash reported in bug item #1872

2025-07-27 Thread Rony G. Flatscher
On 27.07.2025 15:04, Rick McGuire wrote: Actually, your version has a serious flaw in it. The line +InstanceDetacher instDet = InstanceDetacher(tmpInstance.instance); uses a copy constructor, so two instances of an InstanceDetacher get created, which means the destructor gets run twice.

Re: [Oorexx-devel] RFC (Re: Request for fixing crash reported in bug item #1872

2025-07-27 Thread Rick McGuire
Actually, your version has a serious flaw in it. The line +InstanceDetacher instDet = InstanceDetacher(tmpInstance.instance); uses a copy constructor, so two instances of an InstanceDetacher get created, which means the destructor gets run twice. The first probably gets run before the uni

Re: [Oorexx-devel] RFC (Re: Request for fixing crash reported in bug item #1872

2025-07-27 Thread Rick McGuire
I would have put the attachThread() inside the constructor, but that works. Rick On Sun, Jul 27, 2025 at 8:49 AM Rony G. Flatscher wrote: > On 27.07.2025 13:24, Rick McGuire wrote: > > If an exception happens, the detachThread() never happens, which would > leave the interpreter in an inconsist

Re: [Oorexx-devel] RFC (Re: Request for fixing crash reported in bug item #1872

2025-07-27 Thread Rony G. Flatscher
On 27.07.2025 13:24, Rick McGuire wrote: If an exception happens, the detachThread() never happens, which would leave the interpreter in an inconsistent state. The best fix would be to write a small class with a destructor method that will do the detach thread when the variable leaves the scope.

Re: [Oorexx-devel] RFC (Re: Request for fixing crash reported in bug item #1872

2025-07-27 Thread Rick McGuire
If an exception happens, the detachThread() never happens, which would leave the interpreter in an inconsistent state. The best fix would be to write a small class with a destructor method that will do the detach thread when the variable leaves the scope. Rick On Sun, Jul 27, 2025 at 6:51 AM Rony

[Oorexx-devel] RFC (Re: Request for fixing crash reported in bug item #1872

2025-07-27 Thread Rony G. Flatscher
It seems that the following patch fixes the reported crash: Index: interpreter/runtime/Interpreter.cpp === --- interpreter/runtime/Interpreter.cpp (revision 12998) +++ interpreter/runtime/Interpreter.cpp (working copy)