Cleanup GL setup code and remove legacy 1.1 paths.
Reset pointers to NULL when allocations are unbound.

Change-Id: Ifaba634ecbb154970b7fb47faa8e6475d16d2f66
diff --git a/rsScriptC.cpp b/rsScriptC.cpp
index 662791d..cbc5df9 100644
--- a/rsScriptC.cpp
+++ b/rsScriptC.cpp
@@ -56,9 +56,16 @@
                 = nanoseconds_to_milliseconds(systemTime(SYSTEM_TIME_MONOTONIC));
 
     for (uint32_t ct=0; ct < mEnviroment.mFieldCount; ct++) {
-        if (!mSlots[ct].get())
+        if (mSlots[ct].get() && !mTypes[ct].get()) {
+            mTypes[ct].set(mSlots[ct]->getType());
+        }
+
+        if (!mTypes[ct].get())
             continue;
-        void *ptr = mSlots[ct]->getPtr();
+        void *ptr = NULL;
+        if (mSlots[ct].get()) {
+            ptr = mSlots[ct]->getPtr();
+        }
         void **dest = ((void ***)mEnviroment.mFieldAddress)[ct];
         //LOGE("setupScript %i %p = %p    %p %i", ct, dest, ptr, mSlots[ct]->getType(), mSlots[ct]->getType()->getDimX());