As the capture task is executed once, a simple thread can be used for running it instead of a handler. This way the thread stops on task completion and the ViewShot object can be GC'd rather than persisting until the host is destroyed. The hanging threads could make an app run out of memory and crash after continuous use
As the capture task is executed once, a simple thread can be used for running it instead of a handler. This way the thread stops on task completion and the ViewShot object can be GC'd rather than persisting until the host is destroyed. The hanging threads could make an app run out of memory and crash after continuous use