From b452e6845635e7b230e03bf6fa7870ba70f69444 Mon Sep 17 00:00:00 2001 From: Vasily Date: Thu, 27 Dec 2018 14:14:49 +0100 Subject: [PATCH] Fix minor memory leaks The delete keyword only calls a single destructor, the delete[] keyword calls as many destructors as there are members of the array. --- src/tabcontrollers/keyboardinput/KeyboardInputWindows.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tabcontrollers/keyboardinput/KeyboardInputWindows.cpp b/src/tabcontrollers/keyboardinput/KeyboardInputWindows.cpp index fb08ccf..b4f7b6e 100644 --- a/src/tabcontrollers/keyboardinput/KeyboardInputWindows.cpp +++ b/src/tabcontrollers/keyboardinput/KeyboardInputWindows.cpp @@ -89,7 +89,7 @@ void KeyboardInputWindows::sendKeyboardInput(QString input) } sendKeyboardInputRaw(ii, ips); - delete ips; + delete[] ips; } } @@ -100,7 +100,7 @@ void KeyboardInputWindows::sendKeyboardEnter() fillKiStruct(ips[1], VK_RETURN, true); sendKeyboardInputRaw(2, ips); - delete ips; + delete[] ips; } void KeyboardInputWindows::sendKeyboardBackspace(int count) @@ -114,7 +114,7 @@ void KeyboardInputWindows::sendKeyboardBackspace(int count) } sendKeyboardInputRaw(count * 2, ips); - delete ips; + delete[] ips; } } @@ -128,7 +128,7 @@ void KeyboardInputWindows::sendKeyboardAltTab() fillKiStruct(ips[3], VK_MENU, true); sendKeyboardInputRaw(4, ips); - delete ips; + delete[] ips; } }