diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-21 18:51:28 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-21 18:51:28 (GMT) |
| commit | 1cee908c165ead0fcecba4519d4584f3935988b5 (patch) | |
| tree | c03981effdc5543fd9e50f70aab678c9631dbbcd /src/interface | |
| parent | 8ec6aae617525d13697d1c2a612ac37be0f341d5 (diff) | |
| download | powder-1cee908c165ead0fcecba4519d4584f3935988b5.zip powder-1cee908c165ead0fcecba4519d4584f3935988b5.tar.gz | |
Fix thumbnail crash, turns out SaveButton was storing a Thumbnail pointer, not a Thumbnail as I thought
Diffstat (limited to 'src/interface')
| -rw-r--r-- | src/interface/Button.h | 1 | ||||
| -rw-r--r-- | src/interface/SaveButton.cpp | 3 | ||||
| -rw-r--r-- | src/interface/SaveButton.h | 1 | ||||
| -rw-r--r-- | src/interface/Textbox.cpp | 3 | ||||
| -rw-r--r-- | src/interface/Textbox.h | 1 |
5 files changed, 6 insertions, 3 deletions
diff --git a/src/interface/Button.h b/src/interface/Button.h index aabca91..41a057b 100644 --- a/src/interface/Button.h +++ b/src/interface/Button.h @@ -19,6 +19,7 @@ class ButtonAction { public: virtual void ActionCallback(ui::Button * sender) {} + virtual ~ButtonAction() {} }; class Button : public Component diff --git a/src/interface/SaveButton.cpp b/src/interface/SaveButton.cpp index 658a969..38fb974 100644 --- a/src/interface/SaveButton.cpp +++ b/src/interface/SaveButton.cpp @@ -61,8 +61,7 @@ void SaveButton::Tick(float dt) tempThumb = Client::Ref().GetThumbnail(save->GetID(), 0); if(tempThumb) { - thumbnail = tempThumb; //Store a local copy of the thumbnail - cout << (void *)(tempThumb) << " " << (void *)(&thumbnail) << endl; + thumbnail = new Thumbnail(*tempThumb); //Store a local copy of the thumbnail if(thumbnail->Data) { if(thumbnail->Size.Y > (Size.Y-25)) diff --git a/src/interface/SaveButton.h b/src/interface/SaveButton.h index 34652c1..8019a3c 100644 --- a/src/interface/SaveButton.h +++ b/src/interface/SaveButton.h @@ -15,6 +15,7 @@ class SaveButtonAction { public: virtual void ActionCallback(ui::SaveButton * sender) {} + virtual ~SaveButtonAction() {} }; class SaveButton : public Component diff --git a/src/interface/Textbox.cpp b/src/interface/Textbox.cpp index 3cedc15..f087241 100644 --- a/src/interface/Textbox.cpp +++ b/src/interface/Textbox.cpp @@ -162,13 +162,14 @@ void Textbox::OnKeyPress(int key, bool shift, bool ctrl, bool alt) cursor++; changed = true; } + break; } if(changed && actionCallback) { actionCallback->TextChangedCallback(this); } } - catch(std::out_of_range e) + catch(std::out_of_range &e) { cursor = 0; text = ""; diff --git a/src/interface/Textbox.h b/src/interface/Textbox.h index 5cd14f4..099368f 100644 --- a/src/interface/Textbox.h +++ b/src/interface/Textbox.h @@ -13,6 +13,7 @@ class TextboxAction { public: virtual void TextChangedCallback(ui::Textbox * sender) {} + virtual ~TextboxAction() {} }; class Textbox : public Component { |
