diff options
author | Jason Sams <rjsams@android.com> | 2009-09-25 16:50:36 -0700 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2009-09-25 16:50:36 -0700 |
commit | a57e982785d318ddcaa4d86486d63343acefa3fb (patch) | |
tree | 28152ec1e24f54bf9768bff6c7429c37e3557b9a | |
parent | 61f08d6fa7c7657e9fbcd17e9a1c5b9114bb3844 (diff) | |
download | frameworks_base-a57e982785d318ddcaa4d86486d63343acefa3fb.zip frameworks_base-a57e982785d318ddcaa4d86486d63343acefa3fb.tar.gz frameworks_base-a57e982785d318ddcaa4d86486d63343acefa3fb.tar.bz2 |
Fix remaining object leaks. Change FountainView to tear down the rsContext and recreate on rotation to test teardown.
-rw-r--r-- | libs/rs/java/Fountain/src/com/android/fountain/FountainView.java | 13 | ||||
-rw-r--r-- | libs/rs/rsType.cpp | 1 | ||||
-rw-r--r-- | libs/rs/rsType.h | 6 |
3 files changed, 1 insertions, 19 deletions
diff --git a/libs/rs/java/Fountain/src/com/android/fountain/FountainView.java b/libs/rs/java/Fountain/src/com/android/fountain/FountainView.java index 116afd0..cda005e 100644 --- a/libs/rs/java/Fountain/src/com/android/fountain/FountainView.java +++ b/libs/rs/java/Fountain/src/com/android/fountain/FountainView.java @@ -42,7 +42,6 @@ public class FountainView extends RSSurfaceView { public FountainView(Context context) { super(context); - //setFocusable(true); } @@ -59,11 +58,7 @@ public class FountainView extends RSSurfaceView { public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { super.surfaceChanged(holder, format, w, h); - - Log.e("rs", "surfaceChanged"); destroyRS(); - - mRS = createRenderScript(false, true); mRender = new FountainRS(); mRender.init(mRS, getResources(), w, h); @@ -71,15 +66,7 @@ public class FountainView extends RSSurfaceView { public void surfaceDestroyed(SurfaceHolder holder) { // Surface will be destroyed when we return - Log.v("rs", "surfaceDestroyed"); destroyRS(); - - try { - java.lang.Thread.sleep(5000); - } catch(InterruptedException e) { - - } - Runtime.getRuntime().exit(0); } diff --git a/libs/rs/rsType.cpp b/libs/rs/rsType.cpp index 4edd0d4..5ce9ca2 100644 --- a/libs/rs/rsType.cpp +++ b/libs/rs/rsType.cpp @@ -374,6 +374,7 @@ RsType rsi_TypeCreate(Context *rsc) st->setDimLOD(stc->mLOD); st->setDimFaces(stc->mFaces); st->compute(); + stc->mElement.clear(); return st; } diff --git a/libs/rs/rsType.h b/libs/rs/rsType.h index 087e50d..116f1c7 100644 --- a/libs/rs/rsType.h +++ b/libs/rs/rsType.h @@ -139,12 +139,6 @@ public: uint32_t mLOD; bool mFaces; ObjectBaseRef<const Element> mElement; - - ObjectBaseRef<const Type> mIndexType; - ObjectBaseRef<const Type> mPrimitiveType; - ObjectBaseRef<const Type> *mVertexTypes; - - }; |