From a9e7a05b84470257637c97d65f6562aa832c66ef Mon Sep 17 00:00:00 2001 From: Jason Sams Date: Fri, 25 Sep 2009 14:51:22 -0700 Subject: Improve renderscript context teardown. Track object in the system and then force their cleanup by releasing all user references once destroy context is called. Java layer will no longer send destroy notifications for objects garbage collected once a context is destroyed. --- libs/rs/rsProgramRaster.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libs/rs/rsProgramRaster.cpp') diff --git a/libs/rs/rsProgramRaster.cpp b/libs/rs/rsProgramRaster.cpp index b968fe1..2a9c4ab 100644 --- a/libs/rs/rsProgramRaster.cpp +++ b/libs/rs/rsProgramRaster.cpp @@ -24,12 +24,13 @@ using namespace android; using namespace android::renderscript; -ProgramRaster::ProgramRaster(Element *in, +ProgramRaster::ProgramRaster(Context *rsc, + Element *in, Element *out, bool pointSmooth, bool lineSmooth, bool pointSprite) : - Program(in, out) + Program(rsc, in, out) { mPointSmooth = pointSmooth; mLineSmooth = lineSmooth; @@ -95,7 +96,7 @@ ProgramRasterState::~ProgramRasterState() void ProgramRasterState::init(Context *rsc, int32_t w, int32_t h) { - ProgramRaster *pr = new ProgramRaster(NULL, NULL, false, false, false); + ProgramRaster *pr = new ProgramRaster(rsc, NULL, NULL, false, false, false); mDefault.set(pr); } @@ -108,7 +109,8 @@ RsProgramRaster rsi_ProgramRasterCreate(Context * rsc, RsElement in, RsElement o bool lineSmooth, bool pointSprite) { - ProgramRaster *pr = new ProgramRaster(static_cast(in), + ProgramRaster *pr = new ProgramRaster(rsc, + static_cast(in), static_cast(out), pointSmooth, lineSmooth, -- cgit v1.1