octave-maintainers
[Top][All Lists]
Advanced

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

Re: method to reset C++ error_state variable from m-file?


From: Rik
Subject: Re: method to reset C++ error_state variable from m-file?
Date: Sat, 24 Oct 2015 12:19:08 -0700

On 10/24/2015 12:27 AM, Olaf Till wrote:
> On Fri, Oct 23, 2015 at 03:22:47PM -0700, Rik wrote:
>> On 10/23/2015 01:53 PM, John W. Eaton wrote:
>> ...
>>> Maybe this is an error in the implementation of unwind_protect?  Should
>>> the error state be unset, similar to try-catch?  If it is set when the
>>> cleanup block is entered, should it be reset once the cleanup block is
>>> finished?
>> It seems like the error state should be cleared, temporarily, so that the
>> unwind_protect_cleanup block can actually complete the cleanup.  And
>> finally when reaching the end_unwind_protect it should be restored to
>> whatever value it originally had.
> That's what the previous code (stable branch) seemingly already did in
> tree_evaluator::do_unwind_protect_cleanup_code(), seems the new code
> (development branch) just forgot to care for the still existing
> error_state variable ...
>
> Olaf

I haven't checked the code, but you are right that the behavior has changed
on the dev branch relative to the stable branch.  In 3.8.2 and 4.0.0 the
following test code works

sombrero;
get (gcf, "color")
print -dfoo tst.eps
get (gcf, "color")

in that the figure background is restored to white rather than being left
at "none".

--Rik




reply via email to

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