summaryrefslogtreecommitdiffstats
path: root/src/trace/pool.h
diff options
context:
space:
mode:
authorsu_v <suv-sf@users.sourceforge.net>2013-08-29 21:06:10 +0000
committer~suv <suv-sf@users.sourceforge.net>2013-08-29 21:06:10 +0000
commit4d331e73a76dce7d703716093923ca01b3cc5936 (patch)
treeb444657ba269b25f60684e66858a138b74fe240d /src/trace/pool.h
parentFix compiler warnings (diff)
parentUpdating outdated test. Fixes bug #1202271. (diff)
downloadinkscape-4d331e73a76dce7d703716093923ca01b3cc5936.tar.gz
inkscape-4d331e73a76dce7d703716093923ca01b3cc5936.zip
merge from trunk (r12487)
(bzr r11668.1.75)
Diffstat (limited to 'src/trace/pool.h')
-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()