Hi,
I am currently working on updating our existing 3D mouse application to use the new SDK (3.0) with driver version 10.2.3 and am seeing some strange behavior when I my 3D mouse is disconnected. I run through the normal initialization routine, SiInitialize(), SiOpenWinInit(&oData, appWindow), SiOpen(appName, SI_ANY_DEVICE, SI_NO_MASK, SI_EVENT, &oData). In this case, even though there is no device connected, the SiOpen call is returning a valid device handle with a device name of "Notification-Only device". Later on in my message loop I call SiGetEvent (I had been assuming that if I got a valid device handle back from SiOpen then a device was actually connected), in order to see if whatever event I am processing is a 3D mouse event. This call correctly returns that it is not an event but appears to leak memory every time it is called in this situation.
Also note that I see the same behavior in some of the demo applications as well (Chicken, Jet, Puzzle, 3DxTest). If I launch the application with no device attached and move the mouse around in the graphics area the memory for these applications skyrockets.
I am able to work around this currently since it appears that SiGetNumDevices() returns the correct number of connected devices and I can avoid trying to call SiGetEvent if there are 0 connected devices. I have seen situations where SiOpen is returning NULL as I would expect but I am not sure what triggers a NULL return vs a return of a "Notification-Only device".
Is there something that I am missing here or something that I am doing wrong?
Thanks for the help.
Memory Leak with Notification-Only Device
Moderator: Moderators
Re: Memory Leak with Notification-Only Device
Hi dmadigan,
Thanks for reporting this issue. We're currently looking at it.
We believe that you have not done anything wrong as the memleak appears to be somewhere in 3Dconnexion's code.
End-users can prevent the memleak but ensuring that at least one 3Dconnexion is connected or by removing the driver (if no device will be connected).
Thanks for reporting this issue. We're currently looking at it.
We believe that you have not done anything wrong as the memleak appears to be somewhere in 3Dconnexion's code.
End-users can prevent the memleak but ensuring that at least one 3Dconnexion is connected or by removing the driver (if no device will be connected).
Re: Memory Leak with Notification-Only Device
The memory leaks were resolved in version 3.2.0 of the 3DxWare SDK for Windows, published in June 2015.
If your program is affected by this bug, please ensure you link against the libs that ship in the latest SDK.
If your program is affected by this bug, please ensure you link against the libs that ship in the latest SDK.
Nuno Gomes