Improved object lifecycle tracking and fix leaks.
diff --git a/libs/rs/rsProgramVertex.h b/libs/rs/rsProgramVertex.h
index b3a8b8d..e198f23 100644
--- a/libs/rs/rsProgramVertex.h
+++ b/libs/rs/rsProgramVertex.h
@@ -59,12 +59,13 @@
     ~ProgramVertexState();
 
     void init(Context *rsc, int32_t w, int32_t h);
+    void deinit(Context *rsc);
 
     ObjectBaseRef<ProgramVertex> mDefault;
     ObjectBaseRef<ProgramVertex> mLast;
     ObjectBaseRef<Allocation> mDefaultAlloc;
 
-    RsType mAllocType;
+    ObjectBaseRef<Type> mAllocType;
 
     ProgramVertex *mPV;