summaryrefslogtreecommitdiffstats
path: root/src/trace
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2013-08-03 20:44:24 +0000
committerJohan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>2013-08-03 20:44:24 +0000
commitc102402e576d82a87d46026f108d636f70c6a6f8 (patch)
treee1669b4bc7365829abe446fc27a4b51874e2d465 /src/trace
parentsome code cleanup, trying to get it through cppcheck (diff)
downloadinkscape-c102402e576d82a87d46026f108d636f70c6a6f8.tar.gz
inkscape-c102402e576d82a87d46026f108d636f70c6a6f8.zip
fix initialization
(bzr r12459)
Diffstat (limited to 'src/trace')
-rw-r--r--src/trace/pool.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/trace/pool.h b/src/trace/pool.h
index d072a460b..88fd82bcd 100644
--- a/src/trace/pool.h
+++ b/src/trace/pool.h
@@ -59,17 +59,21 @@ class pool {
public:
pool()
- {
+ {
cblock = 0;
size = sizeof(T) > sizeof(void *) ? sizeof(T) : sizeof(void *);
next = NULL;
- }
+ for (int k = 0; k < 64; k++) {
+ block[k] = NULL;
+ }
+ }
~pool()
- {
- for (int k = 0; k < cblock; k++)
- free(block[k]);
- }
+ {
+ for (int k = 0; k < cblock; k++) {
+ free(block[k]);
+ }
+ }
T *draw()
{
@@ -89,7 +93,7 @@ class pool {
int size;
int cblock;
- void *block[64]; //enough to store unlimited number of objects
+ void *block[64]; //enough to store unlimited number of objects, if 64 is changed: see constructor too
void *next;
void addblock()