gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1826-g1eaf85f
Date: Thu, 09 Jan 2014 09:44:20 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  1eaf85f95a8aabb0275447df9500357081bd333a (commit)
      from  093ae927d709fead64fcd9df0501156ccc82f276 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=1eaf85f95a8aabb0275447df9500357081bd333a


commit 1eaf85f95a8aabb0275447df9500357081bd333a
Author: Sandro Santilli <address@hidden>
Date:   Thu Jan 9 10:43:57 2014 +0100

    Fix test buffer leakage and drop _testBufferTmp class member

diff --git a/librender/agg/Renderer_agg.h b/librender/agg/Renderer_agg.h
index f95c4ad..fd5fdb0 100644
--- a/librender/agg/Renderer_agg.h
+++ b/librender/agg/Renderer_agg.h
@@ -30,14 +30,16 @@ class Renderer_agg_base : public Renderer
 {
 private:
     
-    unsigned char *_testBuffer, *_testBufferTmp; // buffers used by 
initTestBuffer() only
+    unsigned char *_testBuffer; // used by initTestBuffer() for testing
     
 public:
     
     Renderer_agg_base() : _testBuffer(0) { }  
     
     // virtual classes should have virtual destructors
-    virtual ~Renderer_agg_base() {}
+    virtual ~Renderer_agg_base() {
+        if ( _testBuffer ) free(_testBuffer);
+    }
     
     // these methods need to be accessed from outside:
     virtual void init_buffer(unsigned char *mem, int size, int x, int y,
@@ -50,12 +52,12 @@ public:
     virtual bool initTestBuffer(unsigned width, unsigned height) {
         int size = width * height * getBytesPerPixel();
         
-        _testBufferTmp = static_cast<unsigned char *>(realloc(_testBuffer, 
size));
-        if (_testBufferTmp == NULL) {
+        unsigned char *tmp = static_cast<unsigned char *>(realloc(_testBuffer, 
size));
+        if (tmp == NULL) {
             log_error(_("Memory reallocation error"));
             return false;
         } else {
-            _testBuffer = _testBufferTmp;
+            _testBuffer = tmp;
         }
 
         memset(_testBuffer, 0, size);
@@ -64,7 +66,7 @@ public:
         init_buffer(_testBuffer, size, width, height, width * 
getBytesPerPixel());
         
         return true;
-    }    
+    }
 };
 
 /// Create a render handler 

-----------------------------------------------------------------------

Summary of changes:
 librender/agg/Renderer_agg.h |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]