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:
parent
b6ab81584f
commit
1430123e58
@ -113,7 +113,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void Free(T **args)
|
void Free(T**& args)
|
||||||
{
|
{
|
||||||
if ( !args )
|
if ( !args )
|
||||||
return;
|
return;
|
||||||
@ -123,6 +123,7 @@ private:
|
|||||||
free(args[n]);
|
free(args[n]);
|
||||||
|
|
||||||
delete [] args;
|
delete [] args;
|
||||||
|
args = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FreeArgs()
|
void FreeArgs()
|
||||||
|
Loading…
Reference in New Issue
Block a user