Bunch of tiny memory leaks fixed and cleanup, フウ〜!

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5056 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Sonicadvance1
2010-02-14 14:06:33 +00:00
parent b6aa5d91c0
commit 5b1d21d1a1
10 changed files with 61 additions and 35 deletions

View File

@ -177,7 +177,8 @@ void DllConfig(HWND _hParent)
if (!m_ConfigFrame)
{
m_ConfigFrame = new DSPConfigDialogHLE(GetParentedWxWindow(_hParent));
wxWindow *frame = GetParentedWxWindow(_hParent);
m_ConfigFrame = new DSPConfigDialogHLE(frame);
// add backends
std::vector<std::string> backends = AudioCommon::GetSoundBackends();
@ -192,6 +193,7 @@ void DllConfig(HWND _hParent)
m_ConfigFrame->ShowModal();
delete m_ConfigFrame;
delete frame;
m_ConfigFrame = 0;
}
#endif

View File

@ -169,10 +169,12 @@ void DllConfig(HWND _hParent)
#if defined(HAVE_WX) && HAVE_WX
if (!m_ConfigFrame)
{
m_ConfigFrame = new GCPadConfigDialog(GetParentedWxWindow(_hParent));
wxWindow *frame = GetParentedWxWindow(_hParent);
m_ConfigFrame = new GCPadConfigDialog(frame);
m_ConfigFrame->ShowModal();
m_ConfigFrame->Destroy();
m_ConfigFrame = NULL;
delete frame;
}
#endif
}
@ -617,19 +619,19 @@ bool IsKey(int Key)
if (MapKey < 256)
{
Ret = GetAsyncKeyState(MapKey); // Keyboard (Windows)
}
}
else if (MapKey < 0x1100)
#elif defined HAVE_X11 && HAVE_X11
#elif defined HAVE_X11 && HAVE_X11
if (HaveFocus() && (MapKey < 256 || MapKey > 0xf000))
{
char keys[32];
KeyCode keyCode;
XQueryKeymap(GCdisplay, keys);
keyCode = XKeysymToKeycode(GCdisplay, MapKey);
Ret = (keys[keyCode/8] & (1 << (keyCode%8))); // Keyboard (Linux)
}
char keys[32];
KeyCode keyCode;
XQueryKeymap(GCdisplay, keys);
keyCode = XKeysymToKeycode(GCdisplay, MapKey);
Ret = (keys[keyCode/8] & (1 << (keyCode%8))); // Keyboard (Linux)
}
else if (MapKey < 0x1100)
#else
#else
if (MapKey < 0x1100)
#endif
{

View File

@ -299,7 +299,8 @@ void DllConfig(HWND _hParent)
// Prevent user to show more than 1 config window at same time
if (allowConfigShow)
{
m_ConfigFrame = new GFXConfigDialogOGL(GetParentedWxWindow(_hParent));
wxWindow *frame = GetParentedWxWindow(_hParent);
m_ConfigFrame = new GFXConfigDialogOGL(frame);
#if defined(_WIN32)
Win32AddResolutions();
@ -314,6 +315,7 @@ void DllConfig(HWND _hParent)
allowConfigShow = m_ConfigFrame->ShowModal() == 1 ? true : false;
delete m_ConfigFrame;
delete frame;
m_ConfigFrame = 0;
}
#endif

View File

@ -183,10 +183,12 @@ void DllConfig(HWND _hParent)
#if defined(HAVE_WX) && HAVE_WX
if (!m_BasicConfigFrame)
{
m_BasicConfigFrame = new WiimoteBasicConfigDialog(GetParentedWxWindow(_hParent));
wxWindow *frame = GetParentedWxWindow(_hParent);
m_BasicConfigFrame = new WiimoteBasicConfigDialog(frame);
m_BasicConfigFrame->ShowModal();
m_BasicConfigFrame->Destroy();
m_BasicConfigFrame = NULL;
delete frame;
}
#endif
}