mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Fixes two memory leaks, which caused the scraper to crash after a while. I believe this fixes #180.
Fixes #352 (duplicate). Fixes #362 (duplicate). The destructor for AsyncHandle needs to be virtual as its subclasses are allocated dynamically. I believe this caused the ImageDownloadHandle and its related resources (such as the HttpReq and its contents) not to be freed correctly.
This commit is contained in:
parent
721b02cfab
commit
1e320b7718
|
@ -12,6 +12,7 @@ class AsyncHandle
|
|||
{
|
||||
public:
|
||||
AsyncHandle() : mStatus(ASYNC_IN_PROGRESS) {};
|
||||
virtual ~AsyncHandle() {};
|
||||
|
||||
virtual void update() = 0;
|
||||
|
||||
|
|
|
@ -14,6 +14,15 @@ NinePatchComponent::NinePatchComponent(Window* window, const std::string& path,
|
|||
buildVertices();
|
||||
}
|
||||
|
||||
NinePatchComponent::~NinePatchComponent()
|
||||
{
|
||||
if (mVertices != NULL)
|
||||
delete[] mVertices;
|
||||
|
||||
if (mColors != NULL)
|
||||
delete[] mColors;
|
||||
}
|
||||
|
||||
void NinePatchComponent::updateColors()
|
||||
{
|
||||
Renderer::buildGLColorArray(mColors, mEdgeColor, 6 * 9);
|
||||
|
|
|
@ -18,6 +18,7 @@ class NinePatchComponent : public GuiComponent
|
|||
{
|
||||
public:
|
||||
NinePatchComponent(Window* window, const std::string& path = "", unsigned int edgeColor = 0xFFFFFFFF, unsigned int centerColor = 0xFFFFFFFF);
|
||||
virtual ~NinePatchComponent();
|
||||
|
||||
void render(const Eigen::Affine3f& parentTrans) override;
|
||||
|
||||
|
|
Loading…
Reference in a new issue