1
0
Fork 0
mirror of https://github.com/quantum5/MusicKeyboard.git synced 2025-04-24 21:21:59 -04:00

I didn't know that I deleted new[] arrays with delete.

This commit is contained in:
Quantum 2013-06-14 19:10:01 -04:00
parent 6978cbc4e6
commit a29f0b11e3
2 changed files with 3 additions and 3 deletions

View file

@ -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);

View file

@ -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++) { \