From 9d5e03db9929271f56ac4a0078d9474d7011efcd Mon Sep 17 00:00:00 2001 From: Jason Sams Date: Tue, 3 Nov 2009 11:25:42 -0800 Subject: Fix RS bugs. We were holding a pointer to the script text from the java vm. Move freeing of objects to before context teardown to allow allocations to clean up their data. --- libs/rs/rsAllocation.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libs/rs/rsAllocation.cpp') diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp index 2cbfe17d40a9..38cec64e3753 100644 --- a/libs/rs/rsAllocation.cpp +++ b/libs/rs/rsAllocation.cpp @@ -54,6 +54,17 @@ Allocation::~Allocation() { free(mPtr); mPtr = NULL; + + if (mBufferID) { + // Causes a SW crash.... + //LOGV(" mBufferID %i", mBufferID); + //glDeleteBuffers(1, &mBufferID); + //mBufferID = 0; + } + if (mTextureID) { + glDeleteTextures(1, &mTextureID); + mTextureID = 0; + } } void Allocation::setCpuWritable(bool) -- cgit v1.2.3-59-g8ed1b