rename tests/main to testmain.cpp
add ANDROID specific work-around for double-cinit bug
git-svn-id: http://skia.googlecode.com/svn/trunk@142 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/core/SkTRegistry.h b/include/core/SkTRegistry.h
index f0f427c..78c5a07 100644
--- a/include/core/SkTRegistry.h
+++ b/include/core/SkTRegistry.h
@@ -28,6 +28,18 @@
typedef T (*Factory)(P);
SkTRegistry(Factory fact) {
+#ifdef ANDROID
+ // work-around for double-initialization bug
+ {
+ SkTRegistry* reg = gHead;
+ while (reg) {
+ if (reg == this) {
+ return;
+ }
+ reg = reg->fChain;
+ }
+ }
+#endif
fFact = fact;
fChain = gHead;
gHead = this;