Merge change 27171 into eclair

* changes:
  Fix remaining object leaks.  Change FountainView to tear down the rsContext and recreate on rotation to test teardown.
This commit is contained in:
Android (Google) Code Review
2009-09-25 19:52:41 -04:00
3 changed files with 1 additions and 19 deletions

View File

@@ -42,7 +42,6 @@ public class FountainView extends RSSurfaceView {
public FountainView(Context context) { public FountainView(Context context) {
super(context); super(context);
//setFocusable(true); //setFocusable(true);
} }
@@ -59,11 +58,7 @@ public class FountainView extends RSSurfaceView {
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
super.surfaceChanged(holder, format, w, h); super.surfaceChanged(holder, format, w, h);
Log.e("rs", "surfaceChanged");
destroyRS(); destroyRS();
mRS = createRenderScript(false, true); mRS = createRenderScript(false, true);
mRender = new FountainRS(); mRender = new FountainRS();
mRender.init(mRS, getResources(), w, h); mRender.init(mRS, getResources(), w, h);
@@ -71,15 +66,7 @@ public class FountainView extends RSSurfaceView {
public void surfaceDestroyed(SurfaceHolder holder) { public void surfaceDestroyed(SurfaceHolder holder) {
// Surface will be destroyed when we return // Surface will be destroyed when we return
Log.v("rs", "surfaceDestroyed");
destroyRS(); destroyRS();
try {
java.lang.Thread.sleep(5000);
} catch(InterruptedException e) {
}
Runtime.getRuntime().exit(0);
} }

View File

@@ -374,6 +374,7 @@ RsType rsi_TypeCreate(Context *rsc)
st->setDimLOD(stc->mLOD); st->setDimLOD(stc->mLOD);
st->setDimFaces(stc->mFaces); st->setDimFaces(stc->mFaces);
st->compute(); st->compute();
stc->mElement.clear();
return st; return st;
} }

View File

@@ -139,12 +139,6 @@ public:
uint32_t mLOD; uint32_t mLOD;
bool mFaces; bool mFaces;
ObjectBaseRef<const Element> mElement; ObjectBaseRef<const Element> mElement;
ObjectBaseRef<const Type> mIndexType;
ObjectBaseRef<const Type> mPrimitiveType;
ObjectBaseRef<const Type> *mVertexTypes;
}; };