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:
Vadim Zeitlin 2015-05-17 22:34:18 +02:00
parent b6ab81584f
commit 1430123e58

View File

@ -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()