mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-09-22 19:41:04 -04:00
Fix a couple of memory leaks (#342)
This commit is contained in:
parent
105afede35
commit
a0c896a0b8
@ -97,6 +97,8 @@ void LegoInputManager::Destroy()
|
||||
if (m_controlManager) {
|
||||
delete m_controlManager;
|
||||
}
|
||||
|
||||
SDL_free(m_joyids);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1005c0f0
|
||||
@ -151,7 +153,9 @@ MxResult LegoInputManager::GetJoystick()
|
||||
}
|
||||
|
||||
MxS32 numJoysticks = 0;
|
||||
m_joyids = SDL_GetJoysticks(&numJoysticks);
|
||||
if (m_joyids == NULL) {
|
||||
m_joyids = SDL_GetJoysticks(&numJoysticks);
|
||||
}
|
||||
|
||||
if (m_useJoystick != FALSE && numJoysticks != 0) {
|
||||
MxS32 joyid = m_joystickIndex;
|
||||
|
@ -819,6 +819,9 @@ HRESULT Direct3DRMViewportImpl::Pick(float x, float y, LPDIRECT3DRMPICKEDARRAY*
|
||||
});
|
||||
|
||||
*pickedArray = new Direct3DRMPickedArrayImpl(hits.data(), hits.size());
|
||||
for (PickRecord& hit : hits) {
|
||||
hit.frameArray->Release();
|
||||
}
|
||||
|
||||
return D3DRM_OK;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user