BUG: cmSourceFile instances should delete their own custom commands when a new one is set.
This commit is contained in:
parent
04b5d1613c
commit
ffb2c0c0e5
|
@ -701,10 +701,6 @@ AddCustomCommandToOutput(const char* outputIn,
|
|||
}
|
||||
if(file)
|
||||
{
|
||||
if (file->GetCustomCommand())
|
||||
{
|
||||
delete file->GetCustomCommand();
|
||||
}
|
||||
file->SetCustomCommand(cc);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -201,3 +201,12 @@ bool cmSourceFile::GetPropertyAsBool(const char* prop) const
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void cmSourceFile::SetCustomCommand(cmCustomCommand* cc)
|
||||
{
|
||||
if(m_CustomCommand)
|
||||
{
|
||||
delete m_CustomCommand;
|
||||
}
|
||||
m_CustomCommand = cc;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
}
|
||||
~cmSourceFile()
|
||||
{
|
||||
if (m_CustomCommand) { delete m_CustomCommand; }
|
||||
this->SetCustomCommand(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -56,8 +56,7 @@ public:
|
|||
const cmCustomCommand *GetCustomCommand() const
|
||||
{return m_CustomCommand;}
|
||||
cmCustomCommand *GetCustomCommand() {return m_CustomCommand;}
|
||||
void SetCustomCommand(cmCustomCommand *cc)
|
||||
{ m_CustomCommand = cc;}
|
||||
void SetCustomCommand(cmCustomCommand *cc);
|
||||
|
||||
/**
|
||||
* Set the name of the file, given the directory the file should be in. IN
|
||||
|
|
Loading…
Reference in New Issue