Fix uninitialized variable bug, add finish()

Change-Id: I79fb54800ad8657c93c7989a5c21838d41f24050
diff --git a/cpp/Allocation.cpp b/cpp/Allocation.cpp
index 7275261..c07e056 100644
--- a/cpp/Allocation.cpp
+++ b/cpp/Allocation.cpp
@@ -37,7 +37,8 @@
 }
 
 Allocation::Allocation(void *id, sp<RS> rs, sp<const Type> t, uint32_t usage) :
-        BaseObj(id, rs) {
+    BaseObj(id, rs), mSelectedY(0), mSelectedZ(0), mSelectedLOD(0),
+    mSelectedFace(RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X) {
 
     if ((usage & ~(RS_ALLOCATION_USAGE_SCRIPT |
                    RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE |
diff --git a/cpp/RenderScript.cpp b/cpp/RenderScript.cpp
index fe4057d..4a96dce 100644
--- a/cpp/RenderScript.cpp
+++ b/cpp/RenderScript.cpp
@@ -161,3 +161,7 @@
 void RS::setMessageHandler(MessageHandlerFunc_t func) {
     mMessageFunc  = func;
 }
+
+void RS::finish() {
+    rsContextFinish(mContext);
+}
diff --git a/cpp/rsCppStructs.h b/cpp/rsCppStructs.h
index abd11c5..b2b6d36 100644
--- a/cpp/rsCppStructs.h
+++ b/cpp/rsCppStructs.h
@@ -56,6 +56,8 @@
 
     RsContext getContext() { return mContext; }
 
+    void finish();
+
  private:
     bool init(int targetApi, bool forceCpu);
     static void * threadProc(void *);