mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-03-06 14:27:43 +00:00
fix segfault on application exit
This commit is contained in:
parent
0587b220cc
commit
a4d4493d3e
|
@ -48,11 +48,15 @@ BadgesComponent::BadgesComponent(Window *window)
|
|||
mImageAltEmu.setImage(mBadgeIcons[SLOT_ALTERNATIVE_EMULATOR], false, true);
|
||||
mImageComponents.insert({SLOT_ALTERNATIVE_EMULATOR, mImageAltEmu});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void BadgesComponent::setValue(const std::string& value)
|
||||
{
|
||||
BadgesComponent::~BadgesComponent() {
|
||||
mBadgeIcons.clear();
|
||||
mImageComponents.clear();
|
||||
}
|
||||
|
||||
|
||||
void BadgesComponent::setValue(const std::string &value) {
|
||||
mChildren.clear();
|
||||
if (!value.empty()) {
|
||||
std::string temp;
|
||||
|
|
|
@ -27,7 +27,9 @@ class TextureResource;
|
|||
class BadgesComponent : public FlexboxComponent
|
||||
{
|
||||
public:
|
||||
BadgesComponent(Window* window);
|
||||
BadgesComponent(Window *window);
|
||||
|
||||
~BadgesComponent() noexcept;
|
||||
|
||||
std::string getValue() const override;
|
||||
// Should be a list of strings.
|
||||
|
|
|
@ -14,21 +14,23 @@
|
|||
|
||||
class TextureResource;
|
||||
|
||||
class ImageComponent : public GuiComponent
|
||||
{
|
||||
class ImageComponent : public GuiComponent {
|
||||
public:
|
||||
ImageComponent(Window* window, bool forceLoad = false, bool dynamic = true);
|
||||
virtual ~ImageComponent() {}
|
||||
ImageComponent(Window *window, bool forceLoad = false, bool dynamic = true);
|
||||
|
||||
virtual ~ImageComponent() noexcept {};
|
||||
|
||||
void setDefaultImage(std::string path) { mDefaultPath = path; }
|
||||
|
||||
// Loads the image at the given filepath. Will tile if tile is true (retrieves texture
|
||||
// as tiling, creates vertices accordingly).
|
||||
void setImage(std::string path, bool tile = false, bool linearMagnify = false);
|
||||
|
||||
// Loads an image from memory.
|
||||
void setImage(const char* data, size_t length, bool tile = false);
|
||||
void setImage(const char *data, size_t length, bool tile = false);
|
||||
|
||||
// Use an already existing texture.
|
||||
void setImage(const std::shared_ptr<TextureResource>& texture);
|
||||
void setImage(const std::shared_ptr<TextureResource> &texture);
|
||||
|
||||
void onSizeChanged() override { updateVertices(); }
|
||||
|
||||
|
|
Loading…
Reference in a new issue