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

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

Fix some leaks. This fixes the major malloc memory leak in allApps. Still...

Fix some leaks.  This fixes the major malloc memory leak in allApps.  Still tracking some much more minor issues.
parent ee98c240
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -52,6 +52,8 @@ Allocation::Allocation(Context *rsc, const Type *type) : ObjectBase(rsc)

Allocation::~Allocation()
{
    free(mPtr);
    mPtr = NULL;
}

void Allocation::setCpuWritable(bool)
+3 −0
Original line number Diff line number Diff line
@@ -350,6 +350,7 @@ void * Context::threadProc(void *vrsc)
     rsc->deinitEGL();
     pthread_mutex_unlock(&gInitMutex);

     rsc->mObjDestroy.mNeedToEmpty = true;
     rsc->objDestroyOOBRun();
     LOGV("RS Thread exited");
     return NULL;
@@ -421,6 +422,7 @@ Context::~Context()

    mIO.shutdown();
    int status = pthread_join(mThreadId, &res);
    mObjDestroy.mNeedToEmpty = true;
    objDestroyOOBRun();

    // Global structure cleanup.
@@ -431,6 +433,7 @@ Context::~Context()
        if (!gThreadTLSKeyCount) {
            pthread_key_delete(gThreadTLSKey);
        }
        mDev = NULL;
    }
    pthread_mutex_unlock(&gInitMutex);

+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ ObjectBase::~ObjectBase()
    rsAssert(!mUserRefCount);
    rsAssert(!mSysRefCount);
    remove();
    delete[] mName;
}

void ObjectBase::dumpLOGV(const char *op) const
+2 −0
Original line number Diff line number Diff line
@@ -99,6 +99,8 @@ SimpleMeshContext::SimpleMeshContext()

SimpleMeshContext::~SimpleMeshContext()
{
    delete[] mVertexTypes;
    delete[] mVertexBuffers;
}


+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ TypeState::TypeState()

TypeState::~TypeState()
{
    delete[] mLODs;
}

size_t Type::getOffsetForFace(uint32_t face) const