#140 closed bug (fixed)
Deletion forgetting
Reported by: | Owned by: | korli | |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Applications | Version: | |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp
KeyboardInputDevice::DeviceWatcher(void *arg) 736: keymap->GetChars(keycode, dev->modifiers, activeDeadKey, &str, &numBytes); 737: keymap->GetChars(keycode, 0, 0, &str2, &numBytes2);
GetChars returns str done new char[]. However, delete[] doesn't do str.
src/add-ons/input_server/devices/keyboard/Keymap.cpp
get_key_map return map, key_buffer done malloc.
Keymap::Keymap() :
fChars(NULL)
{
key_map *keys; get_key_map(&keys, &fChars);
if (keys)
memcpy(&fKeys, keys, sizeof(key_map));
} free doesn't do keys.
status_t Keymap::LoadCurrent() {
key_map *keys = NULL; get_key_map(&keys, &fChars); if (!keys) {
fprintf(stderr, "error while getting current keymap!\n"); return B_ERROR;
} memcpy(&fKeys, keys, sizeof(fKeys)); delete keys; return B_OK;
} free doesn't do fChars. delete keys; -> free(keys);
Change History (6)
comment:1 by , 19 years ago
Resolution: | → fixed |
---|
comment:2 by , 19 years ago
comment:3 by , 19 years ago
Status: | new → closed |
---|
comment:4 by , 19 years ago
Thanks. Another one src/servers/input/InputServer.cpp
void InputServer::_InitKeyboardMouseStates()
BMessage *msg = new BMessage(B_MOUSE_MOVED); HandleSetMousePosition(msg, msg);
Should be fixed in revision 16324.