Fixes for memory issues detected by valgrind

This commit is contained in:
Térence Clastres 2020-08-12 20:29:39 +02:00 committed by Adam Honse
parent ff07a488a2
commit 53379c5482
17 changed files with 74 additions and 27 deletions

View file

@ -33,7 +33,10 @@ EKController::EKController(hid_device* dev_handle, wchar_t *_vendor, wchar_t *_d
EKController::~EKController()
{
hid_close(dev);
if(dev)
{
hid_close(dev);
}
}
char* EKController::GetDeviceName()

View file

@ -31,11 +31,11 @@ static const unsigned int ek_pids[][2] =
void DetectEKControllers(std::vector<RGBController*>& rgb_controllers)
{
hid_device_info* info;
hid_device_info* info = NULL;
//Look for the passed in cm_pids
hid_init();
info = hid_enumerate(0x0, 0x0);
info = hid_enumerate(EK_VID, 0x0);
while(info)
{