sizeof() was being used incorrectly to clear X11 m_keyboard_vector, would only have 4-8 bytes cleared rather then 32.

fix for harmless memleak too.
This commit is contained in:
Campbell Barton 2009-08-01 09:07:45 +00:00
parent e60138117c
commit 41a0bfaf7c
2 changed files with 4 additions and 6 deletions

@ -145,11 +145,9 @@ init(
GHOST_TSuccess success = GHOST_System::init();
if (success) {
m_keyboard_vector = new char[32];
m_displayManager = new GHOST_DisplayManagerX11(this);
if (m_keyboard_vector && m_displayManager) {
if (m_displayManager) {
return GHOST_kSuccess;
}
}
@ -672,9 +670,9 @@ getModifierKeys(
// analyse the masks retuned from XQueryPointer.
memset(m_keyboard_vector,0,sizeof(m_keyboard_vector));
memset((void *)m_keyboard_vector,0,sizeof(m_keyboard_vector));
XQueryKeymap(m_display,m_keyboard_vector);
XQueryKeymap(m_display,(char *)m_keyboard_vector);
// now translate key symobols into keycodes and
// test with vector.

@ -246,7 +246,7 @@ private :
GHOST_TUns64 m_start_time;
/// A vector of keyboard key masks
char *m_keyboard_vector;
char m_keyboard_vector[32];
/**
* Return the ghost window associated with the