Stephen's errata page.
| where | erratum | correct |
|---|---|---|
| page 69 |
missing destructor for class Button
|
~Button {... delete action_; ...}otherwise we have a memory leak |
page 70: no need to new PlayMusic because it is cloned inside of setAction
auto_ptr<PlayMusic> song (new PlayMusic ("AnokoNoNamaewa.mp3"));
b->setAction (song.get ());
instead one could write
b->setAction (&PlayMusic ("AnokoNoNamaewa.mp3"));
probably not all compilers are too excited about taking a reference of a temporary but it should be ok,
or alternatively
PlayMusic pm ("AnokoNoNamaewa.mp3");
b->setAction (&pm);
| page 217 |
typedef True char;
|
typedef char True; |