octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #64242] destructor is executed even if the con


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #64242] destructor is executed even if the constructor fails and throws an error
Date: Tue, 23 May 2023 12:27:36 -0400 (EDT)

Follow-up Comment #1, bug #64242 (project octave):

Fwiw, in Matlab R2023a:

>> myclass()
myclass Delete called
Not enough input arguments.

Error in myclass (line 10)
            self.value = x;


So, it also seems to be calling the destructor for the failed constructor.
(The output is in a different order though. But I don't think that is very
important.)

I'll leave the report open in case others think we should deviate from
Matlab's behavior in that case.
But my two cents are for leaving as it is (i.e., compatible).




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64242>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]