diff --git a/examples/bayes_net_gui_ex.cpp b/examples/bayes_net_gui_ex.cpp index 0651c5621..53ba5d0eb 100644 --- a/examples/bayes_net_gui_ex.cpp +++ b/examples/bayes_net_gui_ex.cpp @@ -171,7 +171,7 @@ int WINAPI WinMain (HINSTANCE, HINSTANCE, PSTR cmds, int) main_window:: main_window( -) try : +) : color_non_evidence(0,0,0), color_default_bg(255,255,255), color_evidence(100,200,100), @@ -261,7 +261,7 @@ main_window( // to all arrange themselves correctly in our window. no_node_selected(); on_window_resized(); -} catch (...) { close_window(); } // make sure close_window() is called if something throws +} // ---------------------------------------------------------------------------------------- diff --git a/examples/gui_api_ex.cpp b/examples/gui_api_ex.cpp index aef024bde..ae98ce6c9 100644 --- a/examples/gui_api_ex.cpp +++ b/examples/gui_api_ex.cpp @@ -100,7 +100,7 @@ class win : public drawable_window */ public: win( - ) try : + ) : c(*this), b(*this), cb(*this,rectangle(100,100,200,200),0,0,255), // the color_box will be blue and 101 pixels wide and tall @@ -144,7 +144,7 @@ public: set_title("dlib gui example"); show(); - } catch (...) { close_window(); } // make sure close window is called if something throws + } ~win( ) diff --git a/examples/image_ex.cpp b/examples/image_ex.cpp index c73ef2604..3478eeff0 100644 --- a/examples/image_ex.cpp +++ b/examples/image_ex.cpp @@ -33,7 +33,7 @@ public: template win( const image_type& img - ) try : + ) : gui_img(*this) { // set the size of this window to match the size of the input image @@ -46,7 +46,7 @@ public: // show this window on the screen show(); - } catch (...) { close_window(); } // make sure close_window() is called if something throws + } ~win( )