summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/progressindicator.cpp11
-rw-r--r--src/gui/widgets/progressindicator.h4
2 files changed, 7 insertions, 8 deletions
diff --git a/src/gui/widgets/progressindicator.cpp b/src/gui/widgets/progressindicator.cpp
index 40523e9a..37aaab62 100644
--- a/src/gui/widgets/progressindicator.cpp
+++ b/src/gui/widgets/progressindicator.cpp
@@ -35,19 +35,16 @@ ProgressIndicator::ProgressIndicator()
ImageSet *images = Theme::getImageSetFromTheme("progress-indicator.png",
32, 32);
- auto *anim = new Animation;
+ Animation anim;
for (size_t i = 0; i < images->size(); ++i)
- anim->addFrame(images->get(i), 100, 0, 0);
+ anim.addFrame(images->get(i), 100, 0, 0);
- mIndicator = new SimpleAnimation(anim);
+ mIndicator = std::make_unique<SimpleAnimation>(std::move(anim));
setSize(32, 32);
}
-ProgressIndicator::~ProgressIndicator()
-{
- delete mIndicator;
-}
+ProgressIndicator::~ProgressIndicator() = default;
void ProgressIndicator::logic()
{
diff --git a/src/gui/widgets/progressindicator.h b/src/gui/widgets/progressindicator.h
index 13cab227..428bbd02 100644
--- a/src/gui/widgets/progressindicator.h
+++ b/src/gui/widgets/progressindicator.h
@@ -23,6 +23,8 @@
#include <guichan/widget.hpp>
+#include <memory>
+
class SimpleAnimation;
/**
@@ -39,7 +41,7 @@ public:
void draw(gcn::Graphics *graphics) override;
private:
- SimpleAnimation *mIndicator;
+ std::unique_ptr<SimpleAnimation> mIndicator;
};
#endif // PROGRESSINDICATOR_H