[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: |
Fri, 23 Oct 2015 15:22:47 -0700 |
On 10/23/2015 01:53 PM, John W. Eaton wrote:
> On 10/23/2015 04:41 PM, rik wrote:
>> 10/23/15
>>
>> The subject line has my question. I am working on a problem with print.m
>> which boils down to this
>>
>> unwind_protect
>> call C++ function which generates error and sets error_state
>> unwind_protect_cleanup
>> Try to clean up by calling C++ function, which terminates quickly
>> because
>> error_state is set.
>> end_unwind_protect
>
> There isn't one that I know of.
>
> 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.
--Rik