mobile/bind: stop tracking foreign objects in the Go reference tracker

ToRefNum only handles Go objects, but it can be passed foreign object
proxies as well. Add a check whether the object is a proxy, and if so,
simply return its refnum and don't track it.

Change-Id: Ib17bd11b48e472c3bec0e5fb06661b201c3dfa97
Reviewed-on: https://go-review.googlesource.com/20681
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
Elias Naur
2016-03-14 17:50:23 +00:00
parent 51fe33c7bf
commit 3e830506b0
10 changed files with 49 additions and 2 deletions
+5
View File
@@ -497,4 +497,9 @@ public class SeqTest extends InstrumentationTestCase {
Testpkg.WithImportedI(i);
Testpkg.WithImportedS(s);
}
public void testIDup() {
Testpkg.I want = new AnI();
assertTrue("java object passed through Go should not be wrapped", want == Testpkg.IDup(want));
}
}