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)
|
||||||
{
|
{
|
||||||
if (file->GetCustomCommand())
|
|
||||||
{
|
|
||||||
delete file->GetCustomCommand();
|
|
||||||
}
|
|
||||||
file->SetCustomCommand(cc);
|
file->SetCustomCommand(cc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,3 +201,12 @@ bool cmSourceFile::GetPropertyAsBool(const char* prop) const
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cmSourceFile::SetCustomCommand(cmCustomCommand* cc)
|
||||||
|
{
|
||||||
|
if(m_CustomCommand)
|
||||||
|
{
|
||||||
|
delete m_CustomCommand;
|
||||||
|
}
|
||||||
|
m_CustomCommand = cc;
|
||||||
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
}
|
}
|
||||||
~cmSourceFile()
|
~cmSourceFile()
|
||||||
{
|
{
|
||||||
if (m_CustomCommand) { delete m_CustomCommand; }
|
this->SetCustomCommand(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -56,8 +56,7 @@ public:
|
||||||
const cmCustomCommand *GetCustomCommand() const
|
const cmCustomCommand *GetCustomCommand() const
|
||||||
{return m_CustomCommand;}
|
{return m_CustomCommand;}
|
||||||
cmCustomCommand *GetCustomCommand() {return m_CustomCommand;}
|
cmCustomCommand *GetCustomCommand() {return m_CustomCommand;}
|
||||||
void SetCustomCommand(cmCustomCommand *cc)
|
void SetCustomCommand(cmCustomCommand *cc);
|
||||||
{ m_CustomCommand = cc;}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the name of the file, given the directory the file should be in. IN
|
* Set the name of the file, given the directory the file should be in. IN
|
||||||
|
|
Loading…
Reference in New Issue