Merge pull request #383 from deadbeef84/scraper-memleak-fix

Fixes two memory leaks, which caused the scraper to crash after a while....
This commit is contained in:
Aloshi 2015-02-10 13:06:09 -06:00
commit 1de0b888aa
3 changed files with 11 additions and 0 deletions

View file

@ -12,6 +12,7 @@ class AsyncHandle
{
public:
AsyncHandle() : mStatus(ASYNC_IN_PROGRESS) {};
virtual ~AsyncHandle() {};
virtual void update() = 0;

View file

@ -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);

View file

@ -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;