pointerdetector2: Avoid problems with released memory

Change-Id: I6cc1f2553d35f6f686cb808aeeb8b3a93ef2f941