Page 1 of 1

[PB 6.0 LTS] InitJoystick() leaks memory

Posted: Mon Oct 24, 2022 9:58 am
by flood
According to the manual InitJoystick() can be called repeatedly to count the number of joysticks connected, but every time this function is called some memory is leaked.

You can test it by running the following code and looking at the task manager:

Code: Select all

Repeat
  InitJoystick()
Forever
Edit: It looks like it was caused by a driver (vjoy) not playing nicely with purebasic. I uninstalled it and the memory leak is gone. I guess this thread can be removed.

// Moved from "Bugs - Windows" to "Coding Questions" (Kiffi)

Re: [PB 6.0 LTS] InitJoystick() leaks memory

Posted: Mon Oct 24, 2022 10:10 am
by BarryG
I don't have a joystick, so I don't know if that makes any difference, but running that code here for 1 minute resulted in an average of 1500 KB in Task Manager for that process, and it didn't go up past that. Win 10 Pro (x64).

Re: [PB 6.0 LTS] InitJoystick() leaks memory

Posted: Mon Oct 24, 2022 10:23 am
by flood
It looks like it was caused by a driver (vjoy) not playing nicely with purebasic. I uninstalled it and the memory leak is gone. I guess this thread can be removed.