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

Commit 7e254a37 authored by Jason Sams's avatar Jason Sams Committed by Android (Google) Code Review
Browse files

Merge "Fix script init error handling."

parents afe8c548 dd39fdfe
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ Script::Script(Context *rsc) : ObjectBase(rsc) {

    mSlots = NULL;
    mTypes = NULL;
    mInitialized = false;
}

Script::~Script() {
+1 −0
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ public:
    virtual void setupScript(Context *rsc) = 0;
    virtual uint32_t run(Context *) = 0;
protected:
    bool mInitialized;
    ObjectBaseRef<Allocation> *mSlots;
    ObjectBaseRef<const Type> *mTypes;

+8 −3
Original line number Diff line number Diff line
@@ -44,9 +44,11 @@ ScriptC::~ScriptC() {
        BT = NULL;
    }
#endif
    if (mInitialized) {
        mRSC->mHal.funcs.script.invokeFreeChildren(mRSC, this);
        mRSC->mHal.funcs.script.destroy(mRSC, this);
    }
}

void ScriptC::setupScript(Context *rsc) {
    mEnviroment.mStartTimeMillis
@@ -212,8 +214,11 @@ bool ScriptC::runCompiler(Context *rsc,
    bitcodeLen = BT->getTranslatedBitcodeSize();
#endif

    rsc->mHal.funcs.script.init(rsc, this, resName, cacheDir, bitcode, bitcodeLen, 0);
    if (!rsc->mHal.funcs.script.init(rsc, this, resName, cacheDir, bitcode, bitcodeLen, 0)) {
        return false;
    }

    mInitialized = true;
    mEnviroment.mFragment.set(rsc->getDefaultProgramFragment());
    mEnviroment.mVertex.set(rsc->getDefaultProgramVertex());
    mEnviroment.mFragmentStore.set(rsc->getDefaultProgramStore());