pointerdetector: Avoid problems with released memory

Change-Id: I3b51f172a4af19de42e421543274a4641b334fc2