We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0993acf commit cc70925Copy full SHA for cc70925
1 file changed
src/Memento/Conceptual/main.cc
@@ -143,6 +143,7 @@ class Originator {
143
void Restore(Memento *memento) {
144
this->state_ = memento->state();
145
std::cout << "Originator: My state has changed to: " << this->state_ << "\n";
146
+ delete memento;
147
}
148
};
149
@@ -229,4 +230,4 @@ int main() {
229
230
std::srand(static_cast<unsigned int>(std::time(NULL)));
231
ClientCode();
232
return 0;
-}
233
+}
0 commit comments