mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-18 19:58:42 +00:00
Fix D3D12EventNode memory leak of D3D12RenderState
- Delete state in copy assignment operator - Added a move assignment operator - Replays with EI containing state changes would have leaked memory
This commit is contained in:
1 parent
36d65ebb18
commit
df1ef003a6
1 file changed
+21
-4
@@ -50,11 +50,28 @@ struct D3D12EventNode
|
||||
{
|
||||
event = a.event;
|
||||
action = a.action;
|
||||
SAFE_DELETE(state);
|
||||
if(a.state)
|
||||
{
|
||||
state = new D3D12RenderState();
|
||||
*state = *a.state;
|
||||
}
|
||||
state = new D3D12RenderState(*a.state);
|
||||
executeData = a.executeData;
|
||||
resourceUsage = a.resourceUsage;
|
||||
debugMessages = a.debugMessages;
|
||||
annotations = a.annotations;
|
||||
cmdListID = a.cmdListID;
|
||||
primaryCmdId = a.primaryCmdId;
|
||||
childCmdBufId = a.childCmdBufId;
|
||||
addActionUse = a.addActionUse;
|
||||
addPrimaryExecute = a.addPrimaryExecute;
|
||||
hasExecuteData = a.hasExecuteData;
|
||||
return *this;
|
||||
}
|
||||
D3D12EventNode &operator=(D3D12EventNode &&a)
|
||||
{
|
||||
event = a.event;
|
||||
action = a.action;
|
||||
SAFE_DELETE(state);
|
||||
state = a.state;
|
||||
a.state = NULL;
|
||||
executeData = a.executeData;
|
||||
resourceUsage = a.resourceUsage;
|
||||
debugMessages = a.debugMessages;
|
||||
|
||||
Reference in new issue
Block a user