* Remove GC timer
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
* Add missing if statement
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
LowMemory?.Invoke(this, e);
if (e.LowMemoryStatus == LowMemoryStatus.SoftWarning || e.LowMemoryStatus == LowMemoryStatus.HardWarning)
{
- double interval = new Random().Next(10 * 1000);
- if (interval <= 0)
- interval = 10 * 1000;
-
- sTimer = new System.Timers.Timer(interval);
- sTimer.Elapsed += OnTimedEvent;
- sTimer.AutoReset = false;
- sTimer.Enabled = true;
+ System.GC.Collect();
}
}
- private static void OnTimedEvent(Object source, ElapsedEventArgs e)
- {
- System.GC.Collect();
- }
-
/// <summary>
/// Overrides this method if want to handle behavior when the system battery is low.
/// If base.OnLowBattery() is not called, the event 'LowBattery' will not be emitted.