\r
namespace es1\r
{\r
-Device *Context::device = 0;\r
-\r
Context::Context(const egl::Config *config, const Context *shareContext)\r
: modelViewStack(MAX_MODELVIEW_STACK_DEPTH),\r
projectionStack(MAX_PROJECTION_STACK_DEPTH),\r
textureStack0(MAX_TEXTURE_STACK_DEPTH),\r
textureStack1(MAX_TEXTURE_STACK_DEPTH)\r
{\r
- device = getDevice();\r
+ sw::Context *context = new sw::Context();\r
+ device = new es1::Device(context);\r
\r
mVertexDataManager = new VertexDataManager(this);\r
mIndexDataManager = new IndexDataManager();\r
delete mIndexDataManager;\r
\r
mResourceManager->release();\r
+ delete device;\r
}\r
\r
void Context::makeCurrent(egl::Surface *surface)\r
\r
Device *Context::getDevice()\r
{\r
- if(!device)\r
- {\r
- sw::Context *context = new sw::Context();\r
- device = new es1::Device(context);\r
- }\r
-\r
return device;\r
}\r
\r
\r
namespace es2\r
{\r
-Device *Context::device = 0;\r
-\r
Context::Context(const egl::Config *config, const Context *shareContext) : mConfig(config)\r
{\r
- device = getDevice();\r
+ sw::Context *context = new sw::Context();\r
+ device = new es2::Device(context);\r
\r
mFenceHandleAllocator.setBaseHandle(0);\r
\r
delete mIndexDataManager;\r
\r
mResourceManager->release();\r
+ delete device;\r
}\r
\r
void Context::makeCurrent(egl::Surface *surface)\r
\r
Device *Context::getDevice()\r
{\r
- if(!device)\r
- {\r
- sw::Context *context = new sw::Context();\r
- device = new es2::Device(context);\r
- }\r
-\r
return device;\r
}\r
\r