mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-25 18:46:58 +01:00
parent
8c12fe742c
commit
26f0b1783e
@ -39,6 +39,7 @@ namespace DS4Windows
|
||||
public static ControlService rootHub;
|
||||
private static Thread testThread;
|
||||
private static Thread controlThread;
|
||||
private static System.Threading.Timer collectTimer;
|
||||
private static Form ds4form;
|
||||
|
||||
private static MemoryMappedFile ipcClassNameMMF = null; // MemoryMappedFile for inter-process communication used to hold className of DS4Form window
|
||||
@ -192,7 +193,10 @@ namespace DS4Windows
|
||||
|
||||
private static void createControlService()
|
||||
{
|
||||
controlThread = new Thread(() => { rootHub = new ControlService(); });
|
||||
controlThread = new Thread(() => {
|
||||
rootHub = new ControlService();
|
||||
collectTimer = new System.Threading.Timer(GarbageTask, null, 30000, 30000);
|
||||
});
|
||||
controlThread.Priority = ThreadPriority.Normal;
|
||||
controlThread.IsBackground = true;
|
||||
controlThread.Start();
|
||||
@ -200,6 +204,11 @@ namespace DS4Windows
|
||||
Thread.SpinWait(500);
|
||||
}
|
||||
|
||||
private static void GarbageTask(object state)
|
||||
{
|
||||
GC.Collect(0, GCCollectionMode.Forced, false);
|
||||
}
|
||||
|
||||
private static void CreateTempWorkerThread()
|
||||
{
|
||||
testThread = new Thread(SingleAppComThread_DoWork);
|
||||
|
Loading…
Reference in New Issue
Block a user