mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 08:53:55 +08:00
Decrement context ref count as a last action in program destructor.
- There are various calls to device inside destructor. - Memory manager is protected via device , which is protected by context. - If context is destroyed it means that device may be destroyed, which means that memory manager may be destroyed and we have a seg fault. Change-Id: I2cb6a69790f53bf2c9fba89160078b009e105574
This commit is contained in:
@@ -98,9 +98,6 @@ Program::Program(Context *context, bool isBuiltIn) : context(context), isBuiltIn
|
||||
}
|
||||
|
||||
Program::~Program() {
|
||||
if (context && !isBuiltIn) {
|
||||
context->decRefInternal();
|
||||
}
|
||||
delete[] genBinary;
|
||||
genBinary = nullptr;
|
||||
|
||||
@@ -129,6 +126,9 @@ Program::~Program() {
|
||||
pDevice->getMemoryManager()->checkGpuUsageAndDestroyGraphicsAllocations(globalSurface);
|
||||
globalSurface = nullptr;
|
||||
}
|
||||
if (context && !isBuiltIn) {
|
||||
context->decRefInternal();
|
||||
}
|
||||
}
|
||||
|
||||
cl_int Program::createProgramFromBinary(
|
||||
|
||||
Reference in New Issue
Block a user