Reset the pointer to NULL after deleting it in wxCmdLineArgsArray.
This ensures that a dangling pointer can't be dereferenced later and fixes a fatal bug if wxCmdLineArgsArray::operator=() was called more than once (which is however not supposed to normally happen).
This commit is contained in:
@@ -113,7 +113,7 @@ public:
|
||||
|
||||
private:
|
||||
template <typename T>
|
||||
void Free(T **args)
|
||||
void Free(T**& args)
|
||||
{
|
||||
if ( !args )
|
||||
return;
|
||||
@@ -123,6 +123,7 @@ private:
|
||||
free(args[n]);
|
||||
|
||||
delete [] args;
|
||||
args = NULL;
|
||||
}
|
||||
|
||||
void FreeArgs()
|
||||
|
Reference in New Issue
Block a user