Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2007-12-27 02:08:00 +0300
committerNicholas Bishop <nicholasbishop@gmail.com>2007-12-27 02:08:00 +0300
commitfc2cf13fc6b66caf09e610a83b793fc8e7da09a1 (patch)
treecc8d06fa67de0b3eddd7765cf482158b3973eeb8 /source/blender/src/sculptmode.c
parent015007beafeaeec09ba8a7fc859acc40ba6b8b16 (diff)
== Sculpt ==
Fixed a memory leak when using the interactive brush resize tool.
Diffstat (limited to 'source/blender/src/sculptmode.c')
-rw-r--r--source/blender/src/sculptmode.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/src/sculptmode.c b/source/blender/src/sculptmode.c
index 64f9ad0283e..f3bfb645315 100644
--- a/source/blender/src/sculptmode.c
+++ b/source/blender/src/sculptmode.c
@@ -1313,6 +1313,7 @@ void sculptmode_propset_end(SculptSession *ss, int cancel)
set_tex_angle(pd->origtexrot);
}
glDeleteTextures(1, &pd->tex);
+ MEM_freeN(pd->num);
MEM_freeN(pd->texdata);
MEM_freeN(pd);
ss->propset= NULL;
@@ -1353,7 +1354,9 @@ void sculptmode_propset_init(PropsetMode mode)
sculptmode_propset_calctex();
- pd->num.idx_max= 0;
+ if(!pd->num)
+ pd->num = MEM_callocN(sizeof(NumInput), "propset numinput");
+ pd->num->idx_max= 0;
}
pd->mode= mode;
@@ -1391,11 +1394,11 @@ void sculptmode_propset(unsigned short event)
BrushData *brush= sculptmode_brush();
char valset= 0;
- handleNumInput(&pd->num, event);
+ handleNumInput(pd->num, event);
- if(hasNumInput(&pd->num)) {
+ if(hasNumInput(pd->num)) {
float val;
- applyNumInput(&pd->num, &val);
+ applyNumInput(pd->num, &val);
if(pd->mode==PropsetSize)
brush->size= val;
else if(pd->mode==PropsetStrength)
@@ -1409,7 +1412,7 @@ void sculptmode_propset(unsigned short event)
switch(event) {
case MOUSEX:
case MOUSEY:
- if(!hasNumInput(&pd->num)) {
+ if(!hasNumInput(pd->num)) {
char ctrl= G.qual & LR_CTRLKEY;
getmouseco_areawin(mouse);
tmp[0]= pd->origloc[0]-mouse[0];