Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a57e9827 authored by Jason Sams's avatar Jason Sams
Browse files

Fix remaining object leaks. Change FountainView to tear down the rsContext...

Fix remaining object leaks.  Change FountainView to tear down the rsContext and recreate on rotation to test teardown.
parent 61f08d6f
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -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);
    }


+1 −0
Original line number Diff line number Diff line
@@ -374,6 +374,7 @@ RsType rsi_TypeCreate(Context *rsc)
    st->setDimLOD(stc->mLOD);
    st->setDimFaces(stc->mFaces);
    st->compute();
    stc->mElement.clear();

    return st;
}
+0 −6
Original line number Diff line number Diff line
@@ -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;


};