summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-10-11 19:55:06 +0200
committerCarl Hetherington <cth@carlh.net>2022-05-02 00:22:43 +0200
commit809bcfd85fad2ef7d4131c054be4cccd5bcc9d05 (patch)
tree8170cee031af2209afa1905b8703f77b6d748d8e /src/tools
parent9a9ce1aec97db89b00bc216edf7cee5f3d48670e (diff)
Replace some raw arrays with std::vectors.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic.cc5
-rw-r--r--src/tools/dcpomatic_player.cc5
2 files changed, 4 insertions, 6 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 8455163bb..e9302c6a0 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -389,7 +389,7 @@ public:
#else
int accelerators = 6;
#endif
- auto accel = new wxAcceleratorEntry[accelerators];
+ std::vector<wxAcceleratorEntry> accel(accelerators);
/* [Shortcut] Ctrl+A:Add file(s) to the film */
accel[0].Set (wxACCEL_CTRL, static_cast<int>('A'), ID_add_file);
/* [Shortcut] Delete:Remove selected content from film */
@@ -411,9 +411,8 @@ public:
Bind (wxEVT_MENU, boost::bind (&DOMFrame::timeline_pressed, this), ID_timeline);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::back_frame, this), ID_back_frame);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::forward_frame, this), ID_forward_frame);
- wxAcceleratorTable accel_table (accelerators, accel);
+ wxAcceleratorTable accel_table (accelerators, accel.data());
SetAcceleratorTable (accel_table);
- delete[] accel;
}
void remove_accelerators ()
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc
index d1d4720ed..7603b9842 100644
--- a/src/tools/dcpomatic_player.cc
+++ b/src/tools/dcpomatic_player.cc
@@ -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);