diff options
Diffstat (limited to 'libs')
-rw-r--r-- | libs/rs/rsContext.cpp | 4 | ||||
-rw-r--r-- | libs/rs/rsLocklessFifo.cpp | 6 | ||||
-rw-r--r-- | libs/rs/rsThreadIO.cpp | 4 |
3 files changed, 6 insertions, 8 deletions
diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index 44e9d89..4f469e1 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -340,10 +340,6 @@ Context::Context() { Context * Context::createContext(Device *dev, const RsSurfaceConfig *sc) { Context * rsc = new Context(); - // Temporary to avoid breaking the tools - if (!dev) { - return rsc; - } if (!rsc->initContext(dev, sc)) { delete rsc; return NULL; diff --git a/libs/rs/rsLocklessFifo.cpp b/libs/rs/rsLocklessFifo.cpp index 70b7278..7023a1f 100644 --- a/libs/rs/rsLocklessFifo.cpp +++ b/libs/rs/rsLocklessFifo.cpp @@ -21,14 +21,16 @@ using namespace android; using namespace android::renderscript; -LocklessCommandFifo::LocklessCommandFifo() { +LocklessCommandFifo::LocklessCommandFifo() : mBuffer(0) { } LocklessCommandFifo::~LocklessCommandFifo() { if (!mInShutdown) { shutdown(); } - free(mBuffer); + if (mBuffer) { + free(mBuffer); + } } void LocklessCommandFifo::shutdown() { diff --git a/libs/rs/rsThreadIO.cpp b/libs/rs/rsThreadIO.cpp index ab164c3..1c8b89c 100644 --- a/libs/rs/rsThreadIO.cpp +++ b/libs/rs/rsThreadIO.cpp @@ -21,8 +21,7 @@ using namespace android; using namespace android::renderscript; -ThreadIO::ThreadIO() { - mToCore.init(16 * 1024); +ThreadIO::ThreadIO() : mUsingSocket(false) { } ThreadIO::~ThreadIO() { @@ -30,6 +29,7 @@ ThreadIO::~ThreadIO() { void ThreadIO::init(bool useSocket) { mUsingSocket = useSocket; + mToCore.init(16 * 1024); if (mUsingSocket) { mToClientSocket.init(); |