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>2021-10-11 20:13:21 +0200
commit44b69f2d9affb048c3d166e3a62bf3462dd5c8b5 (patch)
tree7cf2a540d01c66f9a7d12acfdabd0ee2f4251c80 /src/tools
parent805d4a48fa6e4d8e28fd582a2ae6ba78b8343144 (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 0b7f632e1..2cc3187d6 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -387,7 +387,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 */
@@ -409,9 +409,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 e409b9731..96a22a87f 100644
--- a/src/tools/dcpomatic_player.cc
+++ b/src/tools/dcpomatic_player.cc
@@ -212,7 +212,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);
@@ -227,9 +227,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);