Replace some raw arrays with std::vectors.
[dcpomatic.git] / src / tools / dcpomatic_player.cc
index d1d4720edbbed6afc16adaef0eb90fb2e5b73ae4..7603b9842ac6b345c416fed863c5e5a7c940c451 100644 (file)
@@ -224,7 +224,7 @@ public:
 
                _stress.setup (this, _controls);
 
-               wxAcceleratorEntry* accel = new wxAcceleratorEntry[accelerators];
+               std::vector<wxAcceleratorEntry> accel(accelerators);
                accel[0].Set(wxACCEL_NORMAL,                WXK_SPACE, ID_start_stop);
                accel[1].Set(wxACCEL_NORMAL,                WXK_LEFT,  ID_go_back_frame);
                accel[2].Set(wxACCEL_NORMAL,                WXK_RIGHT, ID_go_forward_frame);
@@ -239,9 +239,8 @@ public:
 #ifdef __WXOSX__
                accel[11].Set(wxACCEL_CTRL, static_cast<int>('W'), ID_file_close);
 #endif
-               wxAcceleratorTable accel_table (accelerators, accel);
+               wxAcceleratorTable accel_table (accelerators, accel.data());
                SetAcceleratorTable (accel_table);
-               delete[] accel;
 
                Bind (wxEVT_MENU, boost::bind(&DOMFrame::start_stop_pressed, this), ID_start_stop);
                Bind (wxEVT_MENU, boost::bind(&DOMFrame::go_back_frame, this),      ID_go_back_frame);