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

Commit aafc7b54 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 27169 into eclair

* changes:
  Improved object lifecycle tracking and fix leaks.
parents 6ecacd40 61f08d6f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -23,11 +23,15 @@ using namespace android::renderscript;

Adapter1D::Adapter1D(Context *rsc) : ObjectBase(rsc)
{
    mAllocFile = __FILE__;
    mAllocLine = __LINE__;
    reset();
}

Adapter1D::Adapter1D(Context *rsc, Allocation *a) : ObjectBase(rsc)
{
    mAllocFile = __FILE__;
    mAllocLine = __LINE__;
    reset();
    setAllocation(a);
}
@@ -127,11 +131,15 @@ void rsi_Adapter1DData(Context *rsc, RsAdapter1D va, const void *data)

Adapter2D::Adapter2D(Context *rsc) : ObjectBase(rsc)
{
    mAllocFile = __FILE__;
    mAllocLine = __LINE__;
    reset();
}

Adapter2D::Adapter2D(Context *rsc, Allocation *a) : ObjectBase(rsc)
{
    mAllocFile = __FILE__;
    mAllocLine = __LINE__;
    reset();
    setAllocation(a);
}
+2 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ using namespace android::renderscript;

Allocation::Allocation(Context *rsc, const Type *type) : ObjectBase(rsc)
{
    mAllocFile = __FILE__;
    mAllocLine = __LINE__;
    mPtr = NULL;

    mCpuWrite = false;
+4 −0
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@ using namespace android::renderscript;

Component::Component(Context *rsc) : ObjectBase(rsc)
{
    mAllocFile = __FILE__;
    mAllocLine = __LINE__;
    mType = FLOAT;
    mKind = USER;
    mIsNormalized = false;
@@ -33,6 +35,8 @@ Component::Component(Context *rsc,
    DataKind dk, DataType dt,
    bool isNormalized, uint32_t bits, const char * name) : ObjectBase(rsc)
{
    mAllocFile = __FILE__;
    mAllocLine = __LINE__;
    mType = dt;
    mKind = dk;
    mIsNormalized = isNormalized;
+9 −4
Original line number Diff line number Diff line
@@ -269,11 +269,16 @@ void * Context::threadProc(void *vrsc)
     }

     LOGV("RS Thread exiting");
     rsc->mRaster.clear();
     rsc->mFragment.clear();
     rsc->mVertex.clear();
     rsc->mFragmentStore.clear();
     rsc->mRootScript.clear();
     rsc->mStateRaster.deinit(rsc);
     rsc->mStateVertex.deinit(rsc);
     rsc->mStateFragment.deinit(rsc);
     rsc->mStateFragmentStore.deinit(rsc);
     ObjectBase::zeroAllUserRef(rsc);
     rsc->mRaster.set(NULL);
     rsc->mFragment.set(NULL);
     rsc->mVertex.set(NULL);
     rsc->mFragmentStore.set(NULL);

     glClearColor(0,0,0,0);
     glClear(GL_COLOR_BUFFER_BIT);
+4 −0
Original line number Diff line number Diff line
@@ -24,12 +24,16 @@ using namespace android::renderscript;

Element::Element(Context *rsc) : ObjectBase(rsc)
{
    mAllocFile = __FILE__;
    mAllocLine = __LINE__;
    mComponents = NULL;
    mComponentCount = 0;
}

Element::Element(Context *rsc, uint32_t count) : ObjectBase(rsc)
{
    mAllocFile = __FILE__;
    mAllocLine = __LINE__;
    mComponents = new ObjectBaseRef<Component> [count];
    mComponentCount = count;
}
Loading