diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-12-30 22:53:23 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-12-30 22:53:23 +0000 |
| commit | f74cd31aa1b14816716ee1ffc59e99d4cc350dd5 (patch) | |
| tree | 7532912e86ab0d7f8c589a3e166dfa177a3f18df /src | |
| parent | 245d3fc91d4d3e30de57b81351e98088500bf865 (diff) | |
Vaguely improve exception safety of ThreadedStaticText.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/wx_util.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 103d36d00..367d1edbb 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -140,11 +140,18 @@ ThreadedStaticText::~ThreadedStaticText () /** Run our thread and post the result to the GUI thread via AddPendingEvent */ void ThreadedStaticText::run (function<string ()> fn) +try { wxCommandEvent ev (wxEVT_COMMAND_TEXT_UPDATED, _update_event_id); ev.SetString (std_to_wx (fn ())); GetEventHandler()->AddPendingEvent (ev); } +catch (...) +{ + /* Ignore exceptions; marginally better than the program quitting, but + only marginally. + */ +} /** Called in the GUI thread when our worker thread has finished */ void |
