pointerdetector: Fix memory management

Change-Id: I6a006de0d3af0fcd98c7cf0e7deee615968a129c