My game runs quite smoothly on PC and Android most of the time, using less than 2% cpu on PC. it runs smoothly on a 5 year old galaxy S1.
But after a few minutes running inside VS2013 (either in debug or release mode) it starts to freeze everytime I click with the mouse, doesn't matter where, doesnt matter if i read or do anything with the click or if its consumed or discarded. The game freezes for about 0.2 seconds and resumes. Its really annoying because my game requires clicking all the time. It doesnt happen when i run the generated .exe manually, but that makes developing and debugging a pain. The only thing i noticed that could explain are some dlls being loaded or unloaded (i see it in the VS output window). I dont have anything to do with the dlls and I dont do anything special that could cause them to load, i think agk calls them. Here is and example of the output i get:
The thread 0x18d4 has exited with code 0 (0x0).
The thread 0xc3c has exited with code 0 (0x0).
The thread 0x1840 has exited with code 0 (0x0).
The thread 0x12e8 has exited with code 0 (0x0).
The thread 0x1888 has exited with code 0 (0x0).
The thread 0x1884 has exited with code 0 (0x0).
The thread 0x176c has exited with code 0 (0x0).
The thread 0xdc0 has exited with code 0 (0x0).
The thread 0x18ac has exited with code 0 (0x0).
The thread 0x1668 has exited with code 0 (0x0).
The thread 0x12e4 has exited with code 0 (0x0).
The thread 0x15c4 has exited with code 0 (0x0).
The thread 0x1330 has exited with code 0 (0x0).
The thread 0x1874 has exited with code 0 (0x0).
The thread 0x454 has exited with code 0 (0x0).
The thread 0x1974 has exited with code 0 (0x0).
The thread 0xe54 has exited with code 0 (0x0).
The thread 0xda0 has exited with code 0 (0x0).
The thread 0xde8 has exited with code 0 (0x0).
The thread 0x1120 has exited with code 0 (0x0).
The thread 0x1114 has exited with code 0 (0x0).
The thread 0x192c has exited with code 0 (0x0).
The thread 0x1758 has exited with code 0 (0x0).
The thread 0x87c has exited with code 0 (0x0).
The thread 0x15fc has exited with code 0 (0x0).
The thread 0x1ac8 has exited with code 0 (0x0).
The thread 0xcb8 has exited with code 0 (0x0).
The thread 0xed0 has exited with code 0 (0x0).
The thread 0x6b4 has exited with code 0 (0x0).
The thread 0x15e4 has exited with code 0 (0x0).
The thread 0x12f0 has exited with code 0 (0x0).
The thread 0x1878 has exited with code 0 (0x0).
The thread 0x1818 has exited with code 0 (0x0).
The thread 0x390 has exited with code 0 (0x0).
The thread 0x1948 has exited with code 0 (0x0).
The thread 0x2d0 has exited with code 0 (0x0).
The thread 0x15c0 has exited with code 0 (0x0).
The thread 0x1578 has exited with code 0 (0x0).
The thread 0x18c4 has exited with code 0 (0x0).
The thread 0x1a08 has exited with code 0 (0x0).
The thread 0xe28 has exited with code 0 (0x0).
The thread 0x11e4 has exited with code 0 (0x0).
The thread 0x1af0 has exited with code 0 (0x0).
The thread 0x1990 has exited with code 0 (0x0).
The thread 0x430 has exited with code 0 (0x0).
The thread 0xee4 has exited with code 0 (0x0).
The thread 0xcc8 has exited with code 0 (0x0).
The thread 0x1994 has exited with code 0 (0x0).
The thread 0x88c has exited with code 0 (0x0).
The thread 0x1b2c has exited with code 0 (0x0).
The thread 0x1a70 has exited with code 0 (0x0).
The thread 0x1b84 has exited with code 0 (0x0).
The thread 0x1a90 has exited with code 0 (0x0).
The thread 0x68c has exited with code 0 (0x0).
The thread 0x6c8 has exited with code 0 (0x0).
The thread 0x10e4 has exited with code 0 (0x0).
The thread 0x9bc has exited with code 0 (0x0).
'jogo.exe' (Win32): Loaded 'C:\Program Files (x86)\GbPlugin\gbieh.dll'. Cannot find or open the PDB file.
'jogo.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'jogo.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\kernel32.dll'
'jogo.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'jogo.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\kernel32.dll'
'jogo.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
'jogo.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\advapi32.dll'
'jogo.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'jogo.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\kernel32.dll'
'jogo.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ieframe.dll'. Cannot find or open the PDB file.
'jogo.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-downlevel-shell32-l1-1-0.dll'. Cannot find or open the PDB file.
'jogo.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'jogo.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ntdll.dll'
The thread 0xe50 has exited with code 1 (0x1).
'jogo.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gameux.dll'. Cannot find or open the PDB file.
'jogo.exe' (Win32): Loaded 'C:\Windows\SysWOW64\xmllite.dll'. Cannot find or open the PDB file.
'jogo.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wer.dll'. Cannot find or open the PDB file.
'jogo.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\gameux.dll'
'jogo.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\wer.dll'
'jogo.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\xmllite.dll'
The thread 0x197c has exited with code 0 (0x0).
The thread 0x1844 has exited with code 1 (0x1).
The thread 0x18bc has exited with code 1 (0x1).
The thread 0x181c has exited with code 1 (0x1).
The thread 0x1a8c has exited with code 1 (0x1).
The thread 0x1b58 has exited with code 1 (0x1).
The thread 0x1850 has exited with code 1 (0x1).
The thread 0x17a0 has exited with code 1 (0x1).
The thread 0x15b4 has exited with code 1 (0x1).
The thread 0x1bf0 has exited with code 0 (0x0).
The thread 0x1a30 has exited with code 0 (0x0).
The thread 0x1274 has exited with code 0 (0x0).
The thread 0x13cc has exited with code 0 (0x0).
The thread 0x1664 has exited with code 0 (0x0).
The thread 0x18c8 has exited with code 0 (0x0).
The thread 0x13f0 has exited with code 0 (0x0).
The thread 0x1270 has exited with code 0 (0x0).
The thread 0xa80 has exited with code 0 (0x0).
The thread 0x18cc has exited with code 0 (0x0).
The thread 0x488 has exited with code 0 (0x0).
The thread 0x1b04 has exited with code 1 (0x1).
The thread 0xfc8 has exited with code 1 (0x1).
The thread 0x1574 has exited with code 1 (0x1).
The thread 0x918 has exited with code 1 (0x1).
The thread 0x1820 has exited with code 1 (0x1).
The thread 0x1670 has exited with code 1 (0x1).
The thread 0x1780 has exited with code 1 (0x1).
The thread 0x1914 has exited with code 1 (0x1).
The thread 0x1244 has exited with code 1 (0x1).
The thread 0x1584 has exited with code 1 (0x1).
The thread 0x159c has exited with code 1 (0x1).
the freezing starts after those dlls are loaded and unloaded. every thread returning 1 is a click and a freeze.
I thought it could be related to sound effects, but it happens even when the clicks are ignored.
Also, whats with all those threads anyway ?
Thanks in advance for any help.