RaiMan / SikuliX-2014

SikuliX version 1.1.2 (until February 2018)
http://sikulix.com
805 stars 235 forks source link

Question related to cleaning up of runningObservers list #290

Open samiahmedshaik opened 6 years ago

samiahmedshaik commented 6 years ago

In the observeDo(double secs) method of Region class, there is a call Observing.addRunningObserver(this); to add the current region to the runningObservers list. But when the observeDo method ends (i.e. Running observer ends), there SHOULD be a call to remove the Region from the runningObservers list (such as Observing.removeRunningObserver(this)) otherwise the memory consumption is increasing as more and more regions gets added to the runningObservers list there by causing Out of Memory exceptions.

I believe the simple fix would be to add Observing.removeRunningObserver(this) at the very end of the observeDo method.

RaiMan commented 6 years ago

Thanks for the pointer. I will check and fix what is needed in 1.1.2 nightly the next days.