diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 26ac9a9..78bc7dc 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -376,7 +376,7 @@ LRESULT MainWindow::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) int size = dnslen(keychars) + 1, i; LPWSTR s; if (m_keychars) - delete m_keychars; + delete [] m_keychars; m_keychars = new WCHAR[size]; for (i = 0; i < size; ++i) { WORD scan = VkKeyScanEx(keychars[i], hklQWERTY); diff --git a/src/PianoControl.cpp b/src/PianoControl.cpp index 168d6f3..b3a7aca 100644 --- a/src/PianoControl.cpp +++ b/src/PianoControl.cpp @@ -76,7 +76,7 @@ void PianoControl::SetOctaves(int octaves) newname = new type[7 * octaves];\ if (store) {\ memcpy(newname, store, min(this->octaves * 7, 7 * octaves) * sizeof(type));\ - delete store;\ + delete [] store;\ } else \ memset(newname, 0, 7 * octaves * sizeof(type));\ store = newname;\ @@ -296,7 +296,7 @@ void PianoControl::PaintContent(PAINTSTRUCT *pps) int bufidx = 0; \ if (bufsize < bufneed) { \ if (szBuffer) \ - delete szBuffer; \ + delete [] szBuffer; \ szBuffer = new WCHAR[bufneed]; \ } \ for (LPCWSTR c = store[i]; *c; c++) { \