mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Don't crash on NULL pointers being dealloc'd
* The error handling code will be OK if a NULL parameter was passed in but during cleanup it will go through tempdealloc, so we need to check that the pointer is actually valid.
This commit is contained in:
@@ -978,7 +978,11 @@ struct pointer_unwrap<T, true>
|
||||
|
||||
static void tempset(U *&ptr, U *tempobj) { ptr = tempobj; }
|
||||
static void tempalloc(U *&ptr, unsigned char *tempmem) { ptr = new(tempmem) U; }
|
||||
static void tempdealloc(U *ptr) { ptr->~U(); }
|
||||
static void tempdealloc(U *ptr)
|
||||
{
|
||||
if(ptr)
|
||||
ptr->~U();
|
||||
}
|
||||
static U &indirect(U *ptr) { return *ptr; }
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user