app: remove incorrect call to AInputQueue_detachLooper

Native activity callback onInputQueueCreated does not attach
a looper to the input queue within android.c. Various examples
of first detaching looper on the web are based around use of
native_app_glue_code which does attach a looper before passing
on to user callback.

Calling detachLooper pre-5.0 results in a crash. I didn't track
down exact source for this but code that likely made it's way
into 5.0 given the time frame can be seen to show a recast of
and iter over size() of a container.

This possibly explains the lack of crashing for 5.0+ instead of
potentially referencing a null pointer pre-5.0.

Fixes golang/go#13741

Change-Id: Ie04de9f34436a95c456a56b34f1ca7e6adc00b09
Reviewed-on: https://go-review.googlesource.com/20145
Reviewed-by: Nigel Tao <nigeltao@golang.org>
This commit is contained in:
Daniel Skinner
2016-03-02 16:45:37 -06:00
committed by Nigel Tao
parent 45143d8b25
commit 39fb9d6163

View File

@ -157,7 +157,6 @@ func onNativeWindowDestroyed(activity *C.ANativeActivity, window *C.ANativeWindo
//export onInputQueueCreated //export onInputQueueCreated
func onInputQueueCreated(activity *C.ANativeActivity, q *C.AInputQueue) { func onInputQueueCreated(activity *C.ANativeActivity, q *C.AInputQueue) {
C.AInputQueue_detachLooper(q)
inputQueue <- q inputQueue <- q
<-inputQueueDone <-inputQueueDone
} }