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

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

[Octave-bug-tracker] [bug #49779] print /non/existing/dir/file.svg crash


From: Rik
Subject: [Octave-bug-tracker] [bug #49779] print /non/existing/dir/file.svg crashes octave
Date: Wed, 7 Dec 2016 16:22:33 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #5, bug #49779 (project octave):

My concern is that we spend a lot of time coding ever more elaborate input
validation tests which still manage to miss some cases.  The whole point of
exception handling is being able to handle unexpected situations.

>From Stroustroup himself at http://www.stroustrup.com/C++11FAQ.html.


Copying and rethrowing exceptions

How do you catch an exception and then rethrow it on another thread? Use a bit
of library magic as described in the standard 18.8.5 Exception Propagation:

    exception_ptr current_exception(); Returns: An exception_ptr object that
refers to the currently handled exception (15.3) or a copy of the currently
handled exception, or a null exception_ptr object if no exception is being
handled. The referenced object shall remain valid at least as long as there is
an exception_ptr object that refers to it. ...
    void rethrow_exception(exception_ptr p);
    template<class E> exception_ptr copy_exception(E e); Effects: as if


        try {
                throw e;
        } catch(...) {
                return current_exception();
        }

    This is particularly useful for transmitting an exception from one thread
to another 


Maybe it would take just as much coder time to do this correctly.  I'm adding
jwe to the CC list since I don't have a great understanding of the
cross-thread issues going on with the GUI.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49779>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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