add destructor for Prototype Pattern

master
FengJungle 2021-10-29 21:13:29 +08:00
parent f9f8fc7dab
commit 990e1a53fd
1 changed files with 4 additions and 0 deletions

View File

@ -46,6 +46,10 @@ public:
work->workModel = this->workModel;
return work;
}
~ConcreteWork(){
delete workModel;
workModel = nullptr;
}
void setName(char* iName){
this->name = iName;