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

Commit 862dadb7 authored by Stephen Hines's avatar Stephen Hines
Browse files

Properly recover from failed compilation.

BUG=5955072

We used to call delete, which did not update the Context's view of the world,
leading to potential segfaults on Context teardown. This change also enables
exceptions to be thrown when runtime errors are encountered.

Change-Id: If63578efff2d7dd03639da1049c1a5ebc69fde35
parent 07c12933
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -837,7 +837,7 @@ public class RenderScript {
                        mRS.mErrorCallback.mErrorNum = subID;
                        mRS.mErrorCallback.run();
                    } else {
                        //throw new RSRuntimeException("Received error num " + subID + ", details: " + e);
                        throw new RSRuntimeException("Received error num " + subID + ", details: " + e);
                    }
                    continue;
                }
+1 −1
Original line number Diff line number Diff line
@@ -322,7 +322,7 @@ RsScript rsi_ScriptCCreate(Context *rsc,

    if (!s->runCompiler(rsc, resName, cacheDir, (uint8_t *)text, text_length)) {
        // Error during compile, destroy s and return null.
        delete s;
        ObjectBase::checkDelete(s);
        return NULL;
    }